| 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 default emitter (full_emitter). | 6 // compilation using the default emitter (full_emitter). |
| 7 library dart2js.kernel.compile_from_dill_test; | 7 library dart2js.kernel.compile_from_dill_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 '../serialization/helper.dart'; | |
| 12 | 10 |
| 13 import 'compile_from_dill_test_helper.dart'; | 11 import 'compile_from_dill_test_helper.dart'; |
| 14 | 12 |
| 15 main(List<String> args) { | 13 main(List<String> args) { |
| 16 asyncTest(() async { | 14 asyncTest(() async { |
| 17 await mainInternal(args); | 15 await runTests(args); |
| 18 }); | 16 }); |
| 19 } | 17 } |
| 20 | |
| 21 Future<ResultKind> mainInternal(List<String> args, | |
| 22 {bool skipWarnings: false, bool skipErrors: false}) async { | |
| 23 Arguments arguments = new Arguments.from(args); | |
| 24 Uri entryPoint; | |
| 25 Map<String, String> memorySourceFiles; | |
| 26 if (arguments.uri != null) { | |
| 27 entryPoint = arguments.uri; | |
| 28 memorySourceFiles = const <String, String>{}; | |
| 29 } else { | |
| 30 entryPoint = Uri.parse('memory:main.dart'); | |
| 31 memorySourceFiles = SOURCE; | |
| 32 } | |
| 33 | |
| 34 return runTest(entryPoint, memorySourceFiles, | |
| 35 verbose: arguments.verbose, | |
| 36 skipWarnings: skipWarnings, | |
| 37 skipErrors: skipErrors); | |
| 38 } | |
| OLD | NEW |