OLD | NEW |
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:io' show File; | 9 import 'dart:io' show File; |
10 | 10 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 bool get isCompiler => fullCompile; | 210 bool get isCompiler => fullCompile; |
211 | 211 |
212 Future<Result<Program>> run( | 212 Future<Result<Program>> run( |
213 TestDescription description, FastaContext context) async { | 213 TestDescription description, FastaContext context) async { |
214 // Disable colors to ensure that expectation files are the same across | 214 // Disable colors to ensure that expectation files are the same across |
215 // platforms and independent of stdin/stderr. | 215 // platforms and independent of stdin/stderr. |
216 CompilerContext.current.disableColors(); | 216 CompilerContext.current.disableColors(); |
217 Program platformOutline = await context.loadPlatformOutline(); | 217 Program platformOutline = await context.loadPlatformOutline(); |
218 Ticker ticker = new Ticker(); | 218 Ticker ticker = new Ticker(); |
219 DillTarget dillTarget = | 219 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator, "vm"); |
220 new DillTarget(ticker, context.uriTranslator, "vm_fasta"); | |
221 platformOutline.unbindCanonicalNames(); | 220 platformOutline.unbindCanonicalNames(); |
222 dillTarget.loader.appendLibraries(platformOutline); | 221 dillTarget.loader.appendLibraries(platformOutline); |
223 // We create a new URI translator to avoid reading plaform libraries from | 222 // We create a new URI translator to avoid reading plaform libraries from |
224 // file system. | 223 // file system. |
225 TranslateUri uriTranslator = new TranslateUri( | 224 TranslateUri uriTranslator = new TranslateUri( |
226 context.uriTranslator.packages, | 225 context.uriTranslator.packages, |
227 const <String, Uri>{}, | 226 const <String, Uri>{}, |
228 const <String, List<Uri>>{}); | 227 const <String, List<Uri>>{}); |
229 KernelTarget sourceTarget = astKind == AstKind.Analyzer | 228 KernelTarget sourceTarget = astKind == AstKind.Analyzer |
230 ? new AnalyzerTarget(dillTarget, uriTranslator, strongMode) | 229 ? new AnalyzerTarget(dillTarget, uriTranslator, strongMode) |
(...skipping 21 matching lines...) Expand all Loading... |
252 return fail(null, instrumentation.problemsAsString); | 251 return fail(null, instrumentation.problemsAsString); |
253 } | 252 } |
254 } | 253 } |
255 } | 254 } |
256 } on InputError catch (e, s) { | 255 } on InputError catch (e, s) { |
257 return fail(null, e.error, s); | 256 return fail(null, e.error, s); |
258 } | 257 } |
259 return pass(p); | 258 return pass(p); |
260 } | 259 } |
261 } | 260 } |
OLD | NEW |