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

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

Issue 2623033007: Fasta targets and loaders. (Closed)
Patch Set: Address review comments. Created 3 years, 11 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
« no previous file with comments | « pkg/fasta/lib/src/source/source_loader.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7 import 'dart:async' show
8 Future; 8 Future;
9 9
10 import 'dart:convert' show 10 import 'dart:convert' show
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 return fullCompile ? "${shortenAstKindName(astKind)} compile" : "outline"; 162 return fullCompile ? "${shortenAstKindName(astKind)} compile" : "outline";
163 } 163 }
164 164
165 bool get isCompiler => fullCompile; 165 bool get isCompiler => fullCompile;
166 166
167 Future<Result<Program>> run( 167 Future<Result<Program>> run(
168 TestDescription description, FeContext context) async { 168 TestDescription description, FeContext context) async {
169 Program platform = await context.createPlatform(); 169 Program platform = await context.createPlatform();
170 Ticker ticker = new Ticker(); 170 Ticker ticker = new Ticker();
171 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator); 171 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator);
172 dillTarget.loader.setProgram(platform); 172 dillTarget.loader
173 ..input = Uri.parse("org.dartlang:platform") // Make up a name.
174 ..setProgram(platform);
173 KernelSourceTarget sourceTarget = 175 KernelSourceTarget sourceTarget =
174 new KernelSourceTarget(dillTarget, context.uriTranslator); 176 new KernelSourceTarget(dillTarget, context.uriTranslator);
175 Program p; 177 Program p;
176 try { 178 try {
177 sourceTarget.read(description.uri); 179 sourceTarget.read(description.uri);
178 await dillTarget.writeOutline(null); 180 await dillTarget.writeOutline(null);
179 p = await sourceTarget.writeOutline(null); 181 p = await sourceTarget.writeOutline(null);
180 if (fullCompile) { 182 if (fullCompile) {
181 p = await sourceTarget.writeProgram(null, astKind); 183 p = await sourceTarget.writeProgram(null, astKind);
182 } 184 }
183 } on InputError catch (e, s) { 185 } on InputError catch (e, s) {
184 return fail(null, e.error, s); 186 return fail(null, e.error, s);
185 } 187 }
186 return pass(p); 188 return pass(p);
187 } 189 }
188 } 190 }
OLDNEW
« no previous file with comments | « pkg/fasta/lib/src/source/source_loader.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698