| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 TestDescription description, FastaContext context) async { | 227 TestDescription description, FastaContext context) async { |
| 228 // Disable colors to ensure that expectation files are the same across | 228 // Disable colors to ensure that expectation files are the same across |
| 229 // platforms and independent of stdin/stderr. | 229 // platforms and independent of stdin/stderr. |
| 230 CompilerContext.current.disableColors(); | 230 CompilerContext.current.disableColors(); |
| 231 Program platformOutline = await context.loadPlatformOutline(); | 231 Program platformOutline = await context.loadPlatformOutline(); |
| 232 Ticker ticker = new Ticker(); | 232 Ticker ticker = new Ticker(); |
| 233 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator, | 233 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator, |
| 234 new TestVmFastaTarget(new TargetFlags(strongMode: strongMode))); | 234 new TestVmFastaTarget(new TargetFlags(strongMode: strongMode))); |
| 235 platformOutline.unbindCanonicalNames(); | 235 platformOutline.unbindCanonicalNames(); |
| 236 dillTarget.loader.appendLibraries(platformOutline); | 236 dillTarget.loader.appendLibraries(platformOutline); |
| 237 // We create a new URI translator to avoid reading plaform libraries from | 237 // We create a new URI translator to avoid reading platform libraries from |
| 238 // file system. | 238 // file system. |
| 239 TranslateUri uriTranslator = new TranslateUri( | 239 TranslateUri uriTranslator = new TranslateUri(const <String, Uri>{}, |
| 240 context.uriTranslator.packages, | 240 const <String, List<Uri>>{}, context.uriTranslator.packages); |
| 241 const <String, Uri>{}, | |
| 242 const <String, List<Uri>>{}); | |
| 243 KernelTarget sourceTarget = astKind == AstKind.Analyzer | 241 KernelTarget sourceTarget = astKind == AstKind.Analyzer |
| 244 ? new AnalyzerTarget(dillTarget, uriTranslator, strongMode) | 242 ? new AnalyzerTarget(dillTarget, uriTranslator, strongMode) |
| 245 : new KernelTarget( | 243 : new KernelTarget( |
| 246 PhysicalFileSystem.instance, dillTarget, uriTranslator); | 244 PhysicalFileSystem.instance, dillTarget, uriTranslator); |
| 247 | 245 |
| 248 Program p; | 246 Program p; |
| 249 try { | 247 try { |
| 250 sourceTarget.read(description.uri); | 248 sourceTarget.read(description.uri); |
| 251 await dillTarget.buildOutlines(); | 249 await dillTarget.buildOutlines(); |
| 252 ValidatingInstrumentation instrumentation; | 250 ValidatingInstrumentation instrumentation; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 } | 312 } |
| 315 } | 313 } |
| 316 | 314 |
| 317 void performGlobalTransformations(CoreTypes coreTypes, Program program, | 315 void performGlobalTransformations(CoreTypes coreTypes, Program program, |
| 318 {void logger(String msg)}) { | 316 {void logger(String msg)}) { |
| 319 if (enabled) { | 317 if (enabled) { |
| 320 super.performGlobalTransformations(coreTypes, program, logger: logger); | 318 super.performGlobalTransformations(coreTypes, program, logger: logger); |
| 321 } | 319 } |
| 322 } | 320 } |
| 323 } | 321 } |
| OLD | NEW |