From beda5c3e620ab6717242823ba4a5c8343b5c733c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20von=20der=20Ah=C3=A9?= Date: Wed, 17 Jan 2018 06:03:59 +0000 Subject: [PATCH] This CL supposedly broke the analyzer, but that isn't true. It broke a single front_end test, and if that was causing you trouble, you could have marked it as failing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert "Revert "Don't skip front-end tests"" This reverts commit b4556e646ecd8b3cfec3bbe0fdb7f06787a9ccba. Reason for revert: Original change's description: > Revert "Don't skip front-end tests" > > This reverts commit 62d225571959b49402bc5daa3faac591732b1022. > > Reason for revert: Broke analyzer bots > > Original change's description: > > Don't skip front-end tests > > > > Change-Id: Ibbd0d63e8c23d045a898e52185fe55e5c53dd6b3 > > Reviewed-on: https://dart-review.googlesource.com/34621 > > Reviewed-by: Jens Johansen > > TBR=ahe@google.com,jensj@google.com > > Change-Id: I6519e0c551dd79d3bd98345925c2db888e892123 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://dart-review.googlesource.com/35020 > Reviewed-by: Paul Berry > Commit-Queue: Paul Berry TBR=paulberry@google.com,ahe@google.com,jensj@google.com Change-Id: I7ff6fd587912fd8a2aba113eb7c765c7b16c5eda No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://dart-review.googlesource.com/35120 Reviewed-by: Peter von der Ahé Commit-Queue: Peter von der Ahé --- .../lib/src/testing/compiler_common.dart | 20 ++++++---- pkg/front_end/test/kernel_generator_test.dart | 38 ++++++++++++++++--- .../test/subpackage_relationships_test.dart | 1 + pkg/front_end/test/whole_program_test.dart | 9 +++-- pkg/pkg.status | 16 +++----- 5 files changed, 57 insertions(+), 27 deletions(-) diff --git a/pkg/front_end/lib/src/testing/compiler_common.dart b/pkg/front_end/lib/src/testing/compiler_common.dart index 81ac570dae7..8e6a904b424 100644 --- a/pkg/front_end/lib/src/testing/compiler_common.dart +++ b/pkg/front_end/lib/src/testing/compiler_common.dart @@ -5,14 +5,19 @@ /// Common compiler options and helper functions used for testing. library front_end.testing.compiler_options_common; -import 'dart:async'; +import 'dart:async' show Future; -import 'dart:io' show Platform; +import 'package:kernel/ast.dart' show Library, Program; -import 'package:front_end/src/api_prototype/front_end.dart'; -import 'package:front_end/src/api_prototype/memory_file_system.dart'; -import 'package:front_end/src/testing/hybrid_file_system.dart'; -import 'package:kernel/ast.dart'; +import '../api_prototype/front_end.dart' + show CompilerOptions, kernelForBuildUnit, kernelForProgram, summaryFor; + +import '../api_prototype/memory_file_system.dart' show MemoryFileSystem; + +import '../compute_platform_binaries_location.dart' + show computePlatformBinariesLocation; + +import '../testing/hybrid_file_system.dart' show HybridFileSystem; /// Generate kernel for a script. /// @@ -99,8 +104,7 @@ Future setup(CompilerOptions options, Map sources, ..packagesFileUri = toTestUri('.packages'); if (options.sdkSummary == null) { - options.sdkRoot = - Uri.base.resolve(Platform.resolvedExecutable).resolve("./"); + options.sdkRoot = computePlatformBinariesLocation(); } } diff --git a/pkg/front_end/test/kernel_generator_test.dart b/pkg/front_end/test/kernel_generator_test.dart index f478b620cf7..ee8b9a0662c 100644 --- a/pkg/front_end/test/kernel_generator_test.dart +++ b/pkg/front_end/test/kernel_generator_test.dart @@ -2,15 +2,41 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:front_end/src/api_prototype/front_end.dart'; -import 'package:front_end/src/fasta/fasta_codes.dart'; -import 'package:front_end/src/fasta/kernel/utils.dart'; +import 'package:kernel/ast.dart' + show EmptyStatement, Program, ReturnStatement, StaticInvocation; + +import 'package:test/test.dart' + show + contains, + expect, + greaterThan, + group, + isEmpty, + isFalse, + isNotEmpty, + isNotNull, + isNull, + isTrue, + same, + test; + +import 'package:front_end/src/api_prototype/front_end.dart' + show CompilerOptions; + import 'package:front_end/src/fasta/deprecated_problems.dart' show deprecated_InputError; -import 'package:front_end/src/testing/compiler_common.dart'; -import 'package:kernel/ast.dart'; -import 'package:test/test.dart'; +import 'package:front_end/src/fasta/fasta_codes.dart' show messageMissingMain; + +import 'package:front_end/src/fasta/kernel/utils.dart' show serializeProgram; + +import 'package:front_end/src/testing/compiler_common.dart' + show + compileScript, + compileUnit, + findLibrary, + invalidCoreLibsSpecUri, + isDartCoreLibrary; main() { group('kernelForProgram', () { diff --git a/pkg/front_end/test/subpackage_relationships_test.dart b/pkg/front_end/test/subpackage_relationships_test.dart index ad06420262d..a0bc923ae8b 100644 --- a/pkg/front_end/test/subpackage_relationships_test.dart +++ b/pkg/front_end/test/subpackage_relationships_test.dart @@ -160,6 +160,7 @@ final subpackageRules = { 'lib/src/fasta/scanner', ]), 'lib/src/testing': new SubpackageRules(allowedDependencies: [ + 'lib/src', 'lib/src/api_prototype', ]), }; diff --git a/pkg/front_end/test/whole_program_test.dart b/pkg/front_end/test/whole_program_test.dart index 6fcbbd07448..6261229d698 100644 --- a/pkg/front_end/test/whole_program_test.dart +++ b/pkg/front_end/test/whole_program_test.dart @@ -8,6 +8,9 @@ import 'dart:io' show Directory, File, Platform; import 'package:async_helper/async_helper.dart' show asyncEnd, asyncStart; import 'package:testing/testing.dart' show StdioProcess; +import 'package:front_end/src/compute_platform_binaries_location.dart' + show computePlatformBinariesLocation; + final Uri compiler = Uri.base.resolve('pkg/front_end/tool/_fasta/compile.dart'); final Uri transform = Uri.base.resolve('pkg/kernel/bin/transform.dart'); @@ -48,14 +51,14 @@ Future main() async { } Future runCompiler(Uri input, Uri output) async { - final buildDir = Uri.base.resolve(Platform.resolvedExecutable).resolve("."); - final platformDill = buildDir.resolve("vm_platform.dill").toFilePath(); + final Uri platformDill = + computePlatformBinariesLocation().resolve("vm_platform.dill"); final List arguments = [ '--packages=${packagesFile.toFilePath()}', '-c', compiler.toFilePath(), - '--platform=$platformDill', + '--platform=${platformDill.toFilePath()}', '--output=${output.toFilePath()}', '--packages=${packagesFile.toFilePath()}', '--verify', diff --git a/pkg/pkg.status b/pkg/pkg.status index 74fe161d09c..21a7c831ae5 100644 --- a/pkg/pkg.status +++ b/pkg/pkg.status @@ -209,25 +209,21 @@ analyzer/test/src/summary/resynthesize_ast_test: Pass, Slow analyzer/test/src/task/strong/front_end_inference_test: Pass, Slow [ $runtime == vm && $use_sdk ] -compiler/tool/generate_kernel_test*: Skip # Issue 28629 -front_end/test/fasta/*: Skip # Issue 28629 -front_end/test/kernel_generator_test: SkipByDesign # depends on patched_sdk which is not built into the sdk -front_end/test/mixin_export_test: SkipByDesign # depends on patched_sdk which is not built into the sdk -front_end/test/summary_generator_test: SkipByDesign # depends on patched_sdk which is not built into the sdk -front_end/tool/_fasta/*: Skip # Issue 28629 -front_end/tool/fasta_perf_test: SkipByDesign # depends on patched_sdk which is not built into the sdk -kernel/test/metadata_test: Skip # Issue 28629 +compiler/tool/generate_kernel_test*: Skip # Issue 31899 +kernel/test/metadata_test: Skip # Issue 31900 # Timeout. These tests do not run efficiently on our simulator or low-end # devices. [ $runtime == vm && ($arch == armv5te || $arch == armv6 || $arch == simarm || $arch == simarm64 || $arch == simarmv5te || $arch == simarmv6 || $arch == simdbc64) ] *: Skip -[ $arch != x64 || $compiler != none || $mode != release || $runtime != vm || $use_sdk ] +[ $arch != x64 || $compiler != none || $mode != release || $runtime != vm ] front_end/test/whole_program_test: SkipByDesign -[ $mode != release || $runtime != vm || $system == windows ] +[ $mode != release || $runtime != vm ] front_end/test/fasta/*: Skip front_end/tool/_fasta/*: Skip + +[ $mode != release || $runtime != vm || $system == windows ] kernel/test/closures_test: Skip