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:compiler/compiler_new.dart'; | 9 import 'package:compiler/compiler_new.dart'; |
10 import 'package:compiler/src/commandline_options.dart'; | 10 import 'package:compiler/src/commandline_options.dart'; |
(...skipping 16 matching lines...) Expand all Loading... |
27 await serializeDartCore(arguments: arguments); | 27 await serializeDartCore(arguments: arguments); |
28 if (arguments.filename != null) { | 28 if (arguments.filename != null) { |
29 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename)); | 29 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename)); |
30 SerializationResult result = await serialize(entryPoint, | 30 SerializationResult result = await serialize(entryPoint, |
31 memorySourceFiles: serializedData.toMemorySourceFiles(), | 31 memorySourceFiles: serializedData.toMemorySourceFiles(), |
32 resolutionInputs: serializedData.toUris()); | 32 resolutionInputs: serializedData.toUris()); |
33 await compile(entryPoint, | 33 await compile(entryPoint, |
34 resolutionInputs: result.serializedData.toUris(), | 34 resolutionInputs: result.serializedData.toUris(), |
35 sourceFiles: result.serializedData.toMemorySourceFiles()); | 35 sourceFiles: result.serializedData.toMemorySourceFiles()); |
36 } else { | 36 } else { |
37 Uri entryPoint = Uri.parse('memory:main.dart'); | |
38 await arguments.forEachTest(serializedData, TESTS, compile); | 37 await arguments.forEachTest(serializedData, TESTS, compile); |
39 } | 38 } |
40 printMeasurementResults(); | 39 printMeasurementResults(); |
41 }); | 40 }); |
42 } | 41 } |
43 | 42 |
44 Future compile(Uri entryPoint, | 43 Future compile(Uri entryPoint, |
45 {Map<String, String> sourceFiles: const <String, String>{}, | 44 {Map<String, String> sourceFiles: const <String, String>{}, |
46 List<Uri> resolutionInputs, | 45 List<Uri> resolutionInputs, |
47 int index, | 46 int index, |
(...skipping 12 matching lines...) Expand all Loading... |
60 entryPoint: entryPoint, | 59 entryPoint: entryPoint, |
61 memorySourceFiles: sourceFiles, | 60 memorySourceFiles: sourceFiles, |
62 resolutionInputs: resolutionInputs, | 61 resolutionInputs: resolutionInputs, |
63 options: options, | 62 options: options, |
64 outputProvider: outputCollector); | 63 outputProvider: outputCollector); |
65 }); | 64 }); |
66 if (verbose) { | 65 if (verbose) { |
67 print(outputCollector.getOutput('', OutputType.js)); | 66 print(outputCollector.getOutput('', OutputType.js)); |
68 } | 67 } |
69 } | 68 } |
OLD | NEW |