Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: tests/compiler/dart2js/serialization/compilation_test.dart

Issue 2013763002: Add names and support for preserialized data to serialization tests (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/serialization/compilation_test.dart
diff --git a/tests/compiler/dart2js/serialization/compilation_test.dart b/tests/compiler/dart2js/serialization/compilation_test.dart
index 595803ab6046c12a44aee17394e87c4f1e68ca5e..9889bf4f7d12fabbf7f2e8d7bf4b415f1ce8c88c 100644
--- a/tests/compiler/dart2js/serialization/compilation_test.dart
+++ b/tests/compiler/dart2js/serialization/compilation_test.dart
@@ -20,31 +20,34 @@ main(List<String> args) {
await serializeDartCore(arguments: arguments);
if (arguments.filename != null) {
Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename));
- await compile(serializedData, entryPoint, null);
+ await compile(
+ entryPoint,
+ resolutionInputs: serializedData.toUris(),
+ sourceFiles: serializedData.toMemorySourceFiles());
} else {
Uri entryPoint = Uri.parse('memory:main.dart');
- await arguments.forEachTest(TESTS, (int index, Test test) async {
- await compile(serializedData, entryPoint, test,
- index: index,
- verbose: arguments.verbose);
- });
+ await arguments.forEachTest(serializedData, TESTS, compile);
}
});
}
-Future compile(SerializedData serializedData, Uri entryPoint, Test test,
- {int index, bool verbose: false}) async {
- String testDescription =
- test != null ? test.sourceFiles[entryPoint.path] : '${entryPoint}';
+Future compile(
+ Uri entryPoint,
+ {Map<String, String> sourceFiles: const <String, String>{},
+ List<Uri> resolutionInputs,
+ int index,
+ Test test,
+ bool verbose: false}) async {
+ String testDescription = test != null ? test.name : '${entryPoint}';
+ String id = index != null ? '$index: ' : '';
print('------------------------------------------------------------------');
- print('compile ${index != null ? '$index:' :''}${testDescription}');
+ print('compile ${id}${testDescription}');
print('------------------------------------------------------------------');
OutputCollector outputCollector = new OutputCollector();
await runCompiler(
entryPoint: entryPoint,
- resolutionInputs: serializedData.toUris(),
- memorySourceFiles: serializedData.toMemorySourceFiles(
- test != null ? test.sourceFiles : null),
+ memorySourceFiles: sourceFiles,
+ resolutionInputs: resolutionInputs,
options: [],
outputProvider: outputCollector);
if (verbose) {
« no previous file with comments | « tests/compiler/dart2js/serialization/analysis_test.dart ('k') | tests/compiler/dart2js/serialization/helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698