| 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 = new DillTarget(ticker, context.uriTranslator, "vm"); | 219 DillTarget dillTarget = |
| 220 new DillTarget(ticker, context.uriTranslator, "vm_fasta"); |
| 220 platformOutline.unbindCanonicalNames(); | 221 platformOutline.unbindCanonicalNames(); |
| 221 dillTarget.loader.appendLibraries(platformOutline); | 222 dillTarget.loader.appendLibraries(platformOutline); |
| 222 // We create a new URI translator to avoid reading plaform libraries from | 223 // We create a new URI translator to avoid reading plaform libraries from |
| 223 // file system. | 224 // file system. |
| 224 TranslateUri uriTranslator = new TranslateUri( | 225 TranslateUri uriTranslator = new TranslateUri( |
| 225 context.uriTranslator.packages, | 226 context.uriTranslator.packages, |
| 226 const <String, Uri>{}, | 227 const <String, Uri>{}, |
| 227 const <String, List<Uri>>{}); | 228 const <String, List<Uri>>{}); |
| 228 KernelTarget sourceTarget = astKind == AstKind.Analyzer | 229 KernelTarget sourceTarget = astKind == AstKind.Analyzer |
| 229 ? new AnalyzerTarget(dillTarget, uriTranslator, strongMode) | 230 ? new AnalyzerTarget(dillTarget, uriTranslator, strongMode) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 251 return fail(null, instrumentation.problemsAsString); | 252 return fail(null, instrumentation.problemsAsString); |
| 252 } | 253 } |
| 253 } | 254 } |
| 254 } | 255 } |
| 255 } on InputError catch (e, s) { | 256 } on InputError catch (e, s) { |
| 256 return fail(null, e.error, s); | 257 return fail(null, e.error, s); |
| 257 } | 258 } |
| 258 return pass(p); | 259 return pass(p); |
| 259 } | 260 } |
| 260 } | 261 } |
| OLD | NEW |