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