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

Side by Side Diff: pkg/front_end/lib/src/fasta/testing/suite.dart

Issue 2832353002: Add support for building patched_sdk and platform.dill for dart2js: (Closed)
Patch Set: rebase Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library fasta.testing.suite; 5 library fasta.testing.suite;
6 6
7 import 'dart:async' show Future; 7 import 'dart:async' show Future;
8 8
9 import 'dart:convert' show JSON; 9 import 'dart:convert' show JSON;
10 10
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 String get name { 173 String get name {
174 return fullCompile ? "${astKind} compile" : "outline"; 174 return fullCompile ? "${astKind} compile" : "outline";
175 } 175 }
176 176
177 bool get isCompiler => fullCompile; 177 bool get isCompiler => fullCompile;
178 178
179 Future<Result<Program>> run( 179 Future<Result<Program>> run(
180 TestDescription description, FastaContext context) async { 180 TestDescription description, FastaContext context) async {
181 Program platform = await context.createPlatform(); 181 Program platform = await context.createPlatform();
182 Ticker ticker = new Ticker(); 182 Ticker ticker = new Ticker();
183 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator); 183 DillTarget dillTarget =
184 new DillTarget(ticker, context.uriTranslator, false);
184 dillTarget.loader 185 dillTarget.loader
185 ..input = Uri.parse("org.dartlang:platform") // Make up a name. 186 ..input = Uri.parse("org.dartlang:platform") // Make up a name.
186 ..setProgram(platform); 187 ..setProgram(platform);
187 KernelTarget sourceTarget = astKind == AstKind.Analyzer 188 KernelTarget sourceTarget = astKind == AstKind.Analyzer
188 ? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode) 189 ? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode)
189 : new KernelTarget(dillTarget, context.uriTranslator, strongMode); 190 : new KernelTarget(
191 dillTarget, context.uriTranslator, strongMode, false);
190 192
191 Program p; 193 Program p;
192 try { 194 try {
193 sourceTarget.read(description.uri); 195 sourceTarget.read(description.uri);
194 await dillTarget.writeOutline(null); 196 await dillTarget.writeOutline(null);
195 ValidatingInstrumentation instrumentation; 197 ValidatingInstrumentation instrumentation;
196 if (strongMode) { 198 if (strongMode) {
197 instrumentation = new ValidatingInstrumentation(); 199 instrumentation = new ValidatingInstrumentation();
198 await instrumentation.loadExpectations(description.uri); 200 await instrumentation.loadExpectations(description.uri);
199 sourceTarget.loader.instrumentation = instrumentation; 201 sourceTarget.loader.instrumentation = instrumentation;
200 } 202 }
201 p = await sourceTarget.writeOutline(null); 203 p = await sourceTarget.writeOutline(null);
202 if (fullCompile) { 204 if (fullCompile) {
203 p = await sourceTarget.writeProgram(null); 205 p = await sourceTarget.writeProgram(null);
204 instrumentation?.finish(); 206 instrumentation?.finish();
205 if (instrumentation != null && instrumentation.hasProblems) { 207 if (instrumentation != null && instrumentation.hasProblems) {
206 if (updateExpectations) { 208 if (updateExpectations) {
207 await instrumentation.fixSource(description.uri); 209 await instrumentation.fixSource(description.uri);
208 } else { 210 } else {
209 return fail(null, instrumentation.problemsAsString); 211 return fail(null, instrumentation.problemsAsString);
210 } 212 }
211 } 213 }
212 } 214 }
213 } on InputError catch (e, s) { 215 } on InputError catch (e, s) {
214 return fail(null, e.error, s); 216 return fail(null, e.error, s);
215 } 217 }
216 return pass(p); 218 return pass(p);
217 } 219 }
218 } 220 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698