OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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_model_test; | 5 library dart2js.serialization_model_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 String id = index != null ? '$index: ' : ''; | 70 String id = index != null ? '$index: ' : ''; |
71 String title = '${id}${testDescription}'; | 71 String title = '${id}${testDescription}'; |
72 Compiler compilerNormal = await measure( | 72 Compiler compilerNormal = await measure( |
73 title, 'compile normal', () async { | 73 title, 'compile normal', () async { |
74 Compiler compilerNormal = compilerFor( | 74 Compiler compilerNormal = compilerFor( |
75 memorySourceFiles: sourceFiles, | 75 memorySourceFiles: sourceFiles, |
76 options: [Flags.analyzeOnly]); | 76 options: [Flags.analyzeOnly]); |
77 compilerNormal.resolution.retainCachesForTesting = true; | 77 compilerNormal.resolution.retainCachesForTesting = true; |
78 await compilerNormal.run(entryPoint); | 78 await compilerNormal.run(entryPoint); |
79 compilerNormal.phase = Compiler.PHASE_DONE_RESOLVING; | 79 compilerNormal.phase = Compiler.PHASE_DONE_RESOLVING; |
80 compilerNormal.openWorld.populate(); | 80 compilerNormal.openWorld.closeWorld(); |
81 compilerNormal.backend.onResolutionComplete(); | 81 compilerNormal.backend.onResolutionComplete(); |
82 compilerNormal.deferredLoadTask.onResolutionComplete( | 82 compilerNormal.deferredLoadTask.onResolutionComplete( |
83 compilerNormal.mainFunction); | 83 compilerNormal.mainFunction); |
84 return compilerNormal; | 84 return compilerNormal; |
85 }); | 85 }); |
86 | 86 |
87 Compiler compilerDeserialized = await measure( | 87 Compiler compilerDeserialized = await measure( |
88 title, 'compile deserialized', () async { | 88 title, 'compile deserialized', () async { |
89 Compiler compilerDeserialized = compilerFor( | 89 Compiler compilerDeserialized = compilerFor( |
90 memorySourceFiles: sourceFiles, | 90 memorySourceFiles: sourceFiles, |
91 resolutionInputs: resolutionInputs, | 91 resolutionInputs: resolutionInputs, |
92 options: [Flags.analyzeOnly]); | 92 options: [Flags.analyzeOnly]); |
93 compilerDeserialized.resolution.retainCachesForTesting = true; | 93 compilerDeserialized.resolution.retainCachesForTesting = true; |
94 await compilerDeserialized.run(entryPoint); | 94 await compilerDeserialized.run(entryPoint); |
95 compilerDeserialized.phase = Compiler.PHASE_DONE_RESOLVING; | 95 compilerDeserialized.phase = Compiler.PHASE_DONE_RESOLVING; |
96 compilerDeserialized.openWorld.populate(); | 96 compilerDeserialized.openWorld.closeWorld(); |
97 compilerDeserialized.backend.onResolutionComplete(); | 97 compilerDeserialized.backend.onResolutionComplete(); |
98 compilerDeserialized.deferredLoadTask.onResolutionComplete( | 98 compilerDeserialized.deferredLoadTask.onResolutionComplete( |
99 compilerDeserialized.mainFunction); | 99 compilerDeserialized.mainFunction); |
100 return compilerDeserialized; | 100 return compilerDeserialized; |
101 }); | 101 }); |
102 | 102 |
103 return measure(title, 'check models', () async { | 103 return measure(title, 'check models', () async { |
104 checkAllImpacts( | 104 checkAllImpacts( |
105 compilerNormal, compilerDeserialized, | 105 compilerNormal, compilerDeserialized, |
106 verbose: verbose); | 106 verbose: verbose); |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 OutputUnit outputUnit1, OutputUnit outputUnit2, String message) { | 407 OutputUnit outputUnit1, OutputUnit outputUnit2, String message) { |
408 if (outputUnit1 == null && outputUnit2 == null) return; | 408 if (outputUnit1 == null && outputUnit2 == null) return; |
409 check(outputUnit1, outputUnit2, | 409 check(outputUnit1, outputUnit2, |
410 'OutputUnit.isMainOutput $message', | 410 'OutputUnit.isMainOutput $message', |
411 outputUnit1.isMainOutput, outputUnit2.isMainOutput); | 411 outputUnit1.isMainOutput, outputUnit2.isMainOutput); |
412 checkSetEquivalence(outputUnit1, outputUnit2, | 412 checkSetEquivalence(outputUnit1, outputUnit2, |
413 'OutputUnit.imports $message', | 413 'OutputUnit.imports $message', |
414 outputUnit1.imports, outputUnit2.imports, | 414 outputUnit1.imports, outputUnit2.imports, |
415 (a, b) => areElementsEquivalent(a.declaration, b.declaration)); | 415 (a, b) => areElementsEquivalent(a.declaration, b.declaration)); |
416 } | 416 } |
OLD | NEW |