Chromium Code Reviews| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'package:async_helper/async_helper.dart'; | 6 import 'package:async_helper/async_helper.dart'; |
| 7 import 'package:compiler/src/commandline_options.dart'; | |
| 8 import 'package:compiler/src/common.dart'; | |
| 9 import 'package:compiler/src/compiler.dart'; | |
| 10 import 'package:compiler/src/kernel/kernel_backend_strategy.dart'; | 7 import 'package:compiler/src/kernel/kernel_backend_strategy.dart'; |
| 11 import 'package:compiler/src/js_model/js_strategy.dart'; | |
| 12 import 'package:expect/expect.dart'; | |
| 13 import '../kernel/compile_from_dill_test_helper.dart'; | 8 import '../kernel/compile_from_dill_test_helper.dart'; |
| 14 import '../kernel/compiler_helper.dart'; | |
| 15 import '../serialization/helper.dart'; | 9 import '../serialization/helper.dart'; |
| 16 | 10 |
| 17 main(List<String> args) { | 11 main(List<String> args) { |
| 18 useJsStrategyForTesting = true; | 12 useJsStrategyForTesting = true; |
| 19 asyncTest(() async { | 13 asyncTest(() async { |
| 20 await mainInternal(args); | 14 await mainInternal(args); |
| 21 }); | 15 }); |
| 22 } | 16 } |
| 23 | 17 |
| 24 Future mainInternal(List<String> args, | 18 Future mainInternal(List<String> args, |
| 25 {bool skipWarnings: false, | 19 {bool skipWarnings: false, |
| 26 bool skipErrors: false, | 20 bool skipErrors: false, |
| 27 List<String> options: const <String>[]}) async { | 21 List<String> options: const <String>[]}) async { |
| 28 Arguments arguments = new Arguments.from(args); | 22 Arguments arguments = new Arguments.from(args); |
| 29 List<Test> tests; | 23 List<Test> tests; |
| 30 if (arguments.uri != null) { | 24 if (arguments.uri != null) { |
| 31 tests = <Test>[new Test.fromUri(arguments.uri)]; | 25 tests = <Test>[new Test.fromUri(arguments.uri)]; |
| 32 } else { | 26 } else { |
| 33 tests = TESTS; | 27 tests = TESTS; |
| 34 } | 28 } |
| 35 for (Test test in tests) { | 29 for (Test test in tests) { |
| 36 if (test.uri != null) { | 30 if (test.uri != null) { |
| 37 print('--- running test uri ${test.uri} -------------------------------'); | 31 print('--- running test uri ${test.uri} -------------------------------'); |
| 38 } else { | 32 } else { |
| 39 print( | 33 print( |
| 40 '--- running test code -------------------------------------------'); | 34 '--- running test code -------------------------------------------'); |
| 41 print(test.sources.values.first); | 35 print(test.sources.values.first); |
| 42 print('----------------------------------------------------------------'); | 36 print('----------------------------------------------------------------'); |
| 43 } | 37 } |
| 44 | 38 await runTest(test.entryPoint, test.sources, |
| 45 enableDebugMode(); | 39 verbose: arguments.verbose, |
|
Siggi Cherem (dart-lang)
2017/07/05 21:25:53
I think I'm missing something: with this change I
Johnni Winther
2017/07/06 14:53:40
By `useJsStrategyForTesting = true;` in line 12.
Siggi Cherem (dart-lang)
2017/07/06 17:47:46
Ah! thanks, indeed that's what I missed. I recall
Johnni Winther
2017/07/07 08:23:50
Yes. I just forgot to remove it earlier.
| |
| 46 | 40 skipWarnings: skipWarnings, |
| 47 Compiler compiler1 = await compileWithDill(test.entryPoint, test.sources, [ | 41 skipErrors: skipErrors, |
| 48 Flags.disableInlining, | 42 options: options, |
| 49 Flags.disableTypeInference | 43 expectAstEquivalence: false, |
| 50 ], beforeRun: (Compiler compiler) { | 44 expectIdenticalOutput: false); |
| 51 compiler.backendStrategy = new JsBackendStrategy(compiler); | |
| 52 }, printSteps: true); | |
| 53 Expect.isFalse(compiler1.compilationFailed); | |
| 54 } | 45 } |
| 55 } | 46 } |
| OLD | NEW |