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

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

Issue 2992383002: Support use of dill in TypeEnv tests (Closed)
Patch Set: Created 3 years, 4 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 if (collector.warnings.isNotEmpty && skipWarnings) { 133 if (collector.warnings.isNotEmpty && skipWarnings) {
134 print('Skipping due to warnings.'); 134 print('Skipping due to warnings.');
135 return ResultKind.warnings; 135 return ResultKind.warnings;
136 } 136 }
137 Expect.isFalse(compiler1.compilationFailed); 137 Expect.isFalse(compiler1.compilationFailed);
138 ResolutionEnqueuer enqueuer1 = compiler1.enqueuer.resolution; 138 ResolutionEnqueuer enqueuer1 = compiler1.enqueuer.resolution;
139 ClosedWorld closedWorld1 = compiler1.resolutionWorldBuilder.closeWorld(); 139 ClosedWorld closedWorld1 = compiler1.resolutionWorldBuilder.closeWorld();
140 140
141 Compiler compiler2 = await compileWithDill( 141 Compiler compiler2 = await compileWithDill(
142 entryPoint, const {}, [Flags.analyzeOnly, Flags.enableAssertMessage], 142 entryPoint: entryPoint,
143 options: [Flags.analyzeOnly, Flags.enableAssertMessage],
143 printSteps: true); 144 printSteps: true);
144 145
145 KernelFrontEndStrategy frontendStrategy = compiler2.frontendStrategy; 146 KernelFrontEndStrategy frontendStrategy = compiler2.frontendStrategy;
146 KernelToElementMap elementMap = frontendStrategy.elementMap; 147 KernelToElementMap elementMap = frontendStrategy.elementMap;
147 148
148 Expect.isFalse(compiler2.compilationFailed); 149 Expect.isFalse(compiler2.compilationFailed);
149 150
150 KernelEquivalence equivalence = new KernelEquivalence(elementMap); 151 KernelEquivalence equivalence = new KernelEquivalence(elementMap);
151 152
152 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution; 153 ResolutionEnqueuer enqueuer2 = compiler2.enqueuer.resolution;
153 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); 154 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld();
154 155
155 checkBackendUsage(closedWorld1.backendUsage, closedWorld2.backendUsage, 156 checkBackendUsage(closedWorld1.backendUsage, closedWorld2.backendUsage,
156 equivalence.defaultStrategy); 157 equivalence.defaultStrategy);
157 158
158 checkResolutionEnqueuers(closedWorld1.backendUsage, closedWorld2.backendUsage, 159 checkResolutionEnqueuers(closedWorld1.backendUsage, closedWorld2.backendUsage,
159 enqueuer1, enqueuer2, 160 enqueuer1, enqueuer2,
160 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b), 161 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b),
161 typeEquivalence: (DartType a, DartType b) { 162 typeEquivalence: (DartType a, DartType b) {
162 return equivalence.typeEquivalence(unalias(a), b); 163 return equivalence.typeEquivalence(unalias(a), b);
163 }, 164 },
164 elementFilter: elementFilter, 165 elementFilter: elementFilter,
165 verbose: arguments.verbose); 166 verbose: arguments.verbose);
166 167
167 checkClosedWorlds(closedWorld1, closedWorld2, 168 checkClosedWorlds(closedWorld1, closedWorld2,
168 strategy: equivalence.defaultStrategy, verbose: arguments.verbose); 169 strategy: equivalence.defaultStrategy, verbose: arguments.verbose);
169 170
170 return ResultKind.success; 171 return ResultKind.success;
171 } 172 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/jsinterop/world_test.dart ('k') | tests/compiler/dart2js/kernel/compile_from_dill_test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698