OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library dart2js.serialization_compilation_test; | 5 library dart2js.serialization_compilation_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 import 'package:compiler/src/commandline_options.dart'; | 10 import 'package:compiler/src/commandline_options.dart'; |
(...skipping 11 matching lines...) Expand all Loading... |
22 Arguments arguments = new Arguments.from(args); | 22 Arguments arguments = new Arguments.from(args); |
23 String serializedData = await serializeDartCore( | 23 String serializedData = await serializeDartCore( |
24 arguments: arguments, | 24 arguments: arguments, |
25 serializeResolvedAst: true); | 25 serializeResolvedAst: true); |
26 if (arguments.filename != null) { | 26 if (arguments.filename != null) { |
27 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename)); | 27 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename)); |
28 await compile(serializedData, entryPoint, null); | 28 await compile(serializedData, entryPoint, null); |
29 } else { | 29 } else { |
30 Uri entryPoint = Uri.parse('memory:main.dart'); | 30 Uri entryPoint = Uri.parse('memory:main.dart'); |
31 // TODO(johnniwinther): Handle the remaining tests. | 31 // TODO(johnniwinther): Handle the remaining tests. |
32 for (Test test in TESTS.sublist(0, 2)) { | 32 for (Test test in TESTS.sublist(0, 5)) { |
33 await compile(serializedData, entryPoint, test, | 33 await compile(serializedData, entryPoint, test, |
34 verbose: arguments.verbose); | 34 verbose: arguments.verbose); |
35 } | 35 } |
36 } | 36 } |
37 }); | 37 }); |
38 } | 38 } |
39 | 39 |
40 Future compile(String serializedData, Uri entryPoint, Test test, | 40 Future compile(String serializedData, Uri entryPoint, Test test, |
41 {bool verbose: false}) async { | 41 {bool verbose: false}) async { |
42 String testDescription = | 42 String testDescription = |
(...skipping 12 matching lines...) Expand all Loading... |
55 Flags.noSourceMaps], | 55 Flags.noSourceMaps], |
56 outputProvider: outputCollector, | 56 outputProvider: outputCollector, |
57 beforeRun: (Compiler compiler) { | 57 beforeRun: (Compiler compiler) { |
58 deserialize(compiler, serializedData, deserializeResolvedAst: true); | 58 deserialize(compiler, serializedData, deserializeResolvedAst: true); |
59 }); | 59 }); |
60 if (verbose) { | 60 if (verbose) { |
61 print(outputCollector.getOutput('', 'js')); | 61 print(outputCollector.getOutput('', 'js')); |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
OLD | NEW |