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

Side by Side Diff: tests/compiler/dart2js/kernel/closed_world_from_dill_test.dart

Issue 2912083002: Add compile_from_dill test (Closed)
Patch Set: Updated cf. comments Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 // Partial test that the closed world computed from [WorldImpact]s derived from 5 // Partial test that the closed world computed from [WorldImpact]s derived from
6 // kernel is equivalent to the original computed from resolution. 6 // kernel is equivalent to the original computed from resolution.
7 library dart2js.kernel.closed_world_from_dill_test; 7 library dart2js.kernel.closed_world_from_dill_test;
8 8
9 import 'dart:async'; 9 import 'dart:async';
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return ResultKind.errors; 118 return ResultKind.errors;
119 } 119 }
120 if (collector.warnings.isNotEmpty && skipWarnings) { 120 if (collector.warnings.isNotEmpty && skipWarnings) {
121 print('Skipping due to warnings.'); 121 print('Skipping due to warnings.');
122 return ResultKind.warnings; 122 return ResultKind.warnings;
123 } 123 }
124 Expect.isFalse(compiler1.compilationFailed); 124 Expect.isFalse(compiler1.compilationFailed);
125 ResolutionEnqueuer enqueuer1 = compiler1.enqueuer.resolution; 125 ResolutionEnqueuer enqueuer1 = compiler1.enqueuer.resolution;
126 ClosedWorld closedWorld1 = compiler1.resolutionWorldBuilder.closeWorld(); 126 ClosedWorld closedWorld1 = compiler1.resolutionWorldBuilder.closeWorld();
127 127
128 Compiler compiler2 = 128 Compiler compiler2 = await compileWithDill(
129 await compileWithDill(entryPoint, const {}, printSteps: true); 129 entryPoint, const {}, [Flags.analyzeOnly, Flags.enableAssertMessage],
130 printSteps: true);
130 131
131 KernelFrontEndStrategy frontEndStrategy = compiler2.frontEndStrategy; 132 KernelFrontEndStrategy frontEndStrategy = compiler2.frontEndStrategy;
132 KernelToElementMap elementMap = frontEndStrategy.elementMap; 133 KernelToElementMap elementMap = frontEndStrategy.elementMap;
133 134
134 Expect.isFalse(compiler2.compilationFailed); 135 Expect.isFalse(compiler2.compilationFailed);
135 136
136 KernelEquivalence equivalence = new KernelEquivalence(elementMap); 137 KernelEquivalence equivalence = new KernelEquivalence(elementMap);
137 138
138 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution; 139 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution;
139 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); 140 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld();
140 141
141 checkBackendUsage(closedWorld1.backendUsage, closedWorld2.backendUsage, 142 checkBackendUsage(closedWorld1.backendUsage, closedWorld2.backendUsage,
142 equivalence.defaultStrategy); 143 equivalence.defaultStrategy);
143 144
144 checkResolutionEnqueuers(closedWorld1.backendUsage, closedWorld2.backendUsage, 145 checkResolutionEnqueuers(closedWorld1.backendUsage, closedWorld2.backendUsage,
145 enqueuer1, enqueuer2, elementEquivalence: equivalence.entityEquivalence, 146 enqueuer1, enqueuer2, elementEquivalence: equivalence.entityEquivalence,
146 typeEquivalence: (ResolutionDartType a, DartType b) { 147 typeEquivalence: (ResolutionDartType a, DartType b) {
147 return equivalence.typeEquivalence(unalias(a), b); 148 return equivalence.typeEquivalence(unalias(a), b);
148 }, elementFilter: elementFilter, verbose: arguments.verbose); 149 }, elementFilter: elementFilter, verbose: arguments.verbose);
149 150
150 checkClosedWorlds(closedWorld1, closedWorld2, 151 checkClosedWorlds(closedWorld1, closedWorld2,
151 strategy: equivalence.defaultStrategy, verbose: arguments.verbose); 152 strategy: equivalence.defaultStrategy, verbose: arguments.verbose);
152 153
153 return ResultKind.success; 154 return ResultKind.success;
154 } 155 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/equivalence/check_functions.dart ('k') | tests/compiler/dart2js/kernel/compile_from_dill_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698