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

Unified Diff: tests/compiler/dart2js/serialization/model_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/model_test.dart
diff --git a/tests/compiler/dart2js/serialization/model_test.dart b/tests/compiler/dart2js/serialization/model_test.dart
index 2ab28e9eee59521b15d555c95d41a69199162c78..dd86acd1cb76e0138c78437118c56326097ce0ba 100644
--- a/tests/compiler/dart2js/serialization/model_test.dart
+++ b/tests/compiler/dart2js/serialization/model_test.dart
@@ -28,33 +28,31 @@ main(List<String> args) {
await serializeDartCore(arguments: arguments);
if (arguments.filename != null) {
Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename));
- await checkModels(serializedData, entryPoint);
+ await checkModels(entryPoint,
+ sourceFiles: serializedData.toMemorySourceFiles(),
+ resolutionInputs: serializedData.toUris());
} else {
Uri entryPoint = Uri.parse('memory:main.dart');
- arguments.forEachTest(TESTS, (int index, Test test) async {
- print('==============================================================');
- print(test.sourceFiles);
- await checkModels(
- serializedData,
- entryPoint,
- memorySourceFiles: test.sourceFiles,
- verbose: arguments.verbose);
- });
+ arguments.forEachTest(serializedData, TESTS, checkModels);
}
});
}
Future checkModels(
- SerializedData serializedData,
Uri entryPoint,
- {Map<String, String> memorySourceFiles: const <String, String>{},
- bool verbose: false}) async {
+ {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 normal');
+ print('compile normal ${id}${testDescription}');
print('------------------------------------------------------------------');
Compiler compilerNormal = compilerFor(
- memorySourceFiles: memorySourceFiles,
+ memorySourceFiles: sourceFiles,
options: [Flags.analyzeOnly]);
compilerNormal.resolution.retainCachesForTesting = true;
await compilerNormal.run(entryPoint);
@@ -63,11 +61,11 @@ Future checkModels(
compilerNormal.backend.onResolutionComplete();
print('------------------------------------------------------------------');
- print('compile deserialized');
+ print('compile deserialized ${id}${testDescription}');
print('------------------------------------------------------------------');
Compiler compilerDeserialized = compilerFor(
- memorySourceFiles: serializedData.toMemorySourceFiles(memorySourceFiles),
- resolutionInputs: serializedData.toUris(),
+ memorySourceFiles: sourceFiles,
+ resolutionInputs: resolutionInputs,
options: [Flags.analyzeOnly]);
compilerDeserialized.resolution.retainCachesForTesting = true;
await compilerDeserialized.run(entryPoint);
« no previous file with comments | « tests/compiler/dart2js/serialization/helper.dart ('k') | tests/compiler/dart2js/serialization/resolved_ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698