OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Test compilation equivalence between source and .dill based | 5 // Test compilation equivalence between source and .dill based |
6 // compilation using the fast_startup emitter. | 6 // compilation using the fast_startup emitter. |
7 library dart2js.kernel.compile_from_dill_fast_startup_test; | 7 library dart2js.kernel.compile_from_dill_fast_startup_test; |
8 | 8 |
9 import 'dart:async'; | |
10 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
11 import 'package:compiler/src/commandline_options.dart'; | 10 import 'package:compiler/src/commandline_options.dart'; |
12 import '../serialization/helper.dart'; | |
13 | 11 |
14 import 'compile_from_dill_test_helper.dart'; | 12 import 'compile_from_dill_test_helper.dart'; |
15 | 13 |
16 main(List<String> args) { | 14 main(List<String> args) { |
17 asyncTest(() async { | 15 asyncTest(() async { |
18 await mainInternal(args); | 16 await runTests(args, options: [Flags.fastStartup]); |
19 }); | 17 }); |
20 } | 18 } |
21 | |
22 Future<ResultKind> mainInternal(List<String> args, | |
23 {bool skipWarnings: false, bool skipErrors: false}) async { | |
24 Arguments arguments = new Arguments.from(args); | |
25 Uri entryPoint; | |
26 Map<String, String> memorySourceFiles; | |
27 if (arguments.uri != null) { | |
28 entryPoint = arguments.uri; | |
29 memorySourceFiles = const <String, String>{}; | |
30 } else { | |
31 entryPoint = Uri.parse('memory:main.dart'); | |
32 memorySourceFiles = SOURCE; | |
33 } | |
34 | |
35 return runTest(entryPoint, memorySourceFiles, | |
36 verbose: arguments.verbose, | |
37 skipWarnings: skipWarnings, | |
38 skipErrors: skipErrors, | |
39 options: [Flags.fastStartup]); | |
40 } | |
OLD | NEW |