| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 return fullCompile ? "${astKind} compile" : "outline"; | 186 return fullCompile ? "${astKind} compile" : "outline"; |
| 187 } | 187 } |
| 188 | 188 |
| 189 bool get isCompiler => fullCompile; | 189 bool get isCompiler => fullCompile; |
| 190 | 190 |
| 191 Future<Result<Program>> run( | 191 Future<Result<Program>> run( |
| 192 TestDescription description, FastaContext context) async { | 192 TestDescription description, FastaContext context) async { |
| 193 Program platform = await context.loadPlatform(); | 193 Program platform = await context.loadPlatform(); |
| 194 Ticker ticker = new Ticker(); | 194 Ticker ticker = new Ticker(); |
| 195 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator); | 195 DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator); |
| 196 dillTarget.loader | 196 dillTarget.loader.setProgram(platform); |
| 197 ..input = Uri.parse("org.dartlang:platform") // Make up a name. | |
| 198 ..setProgram(platform); | |
| 199 KernelTarget sourceTarget = astKind == AstKind.Analyzer | 197 KernelTarget sourceTarget = astKind == AstKind.Analyzer |
| 200 ? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode) | 198 ? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode) |
| 201 : new KernelTarget(PhysicalFileSystem.instance, dillTarget, | 199 : new KernelTarget(PhysicalFileSystem.instance, dillTarget, |
| 202 context.uriTranslator, strongMode); | 200 context.uriTranslator, strongMode); |
| 203 | 201 |
| 204 Program p; | 202 Program p; |
| 205 try { | 203 try { |
| 206 sourceTarget.read(description.uri); | 204 sourceTarget.read(description.uri); |
| 207 await dillTarget.writeOutline(null); | 205 await dillTarget.writeOutline(null); |
| 208 ValidatingInstrumentation instrumentation; | 206 ValidatingInstrumentation instrumentation; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 222 return fail(null, instrumentation.problemsAsString); | 220 return fail(null, instrumentation.problemsAsString); |
| 223 } | 221 } |
| 224 } | 222 } |
| 225 } | 223 } |
| 226 } on InputError catch (e, s) { | 224 } on InputError catch (e, s) { |
| 227 return fail(null, e.error, s); | 225 return fail(null, e.error, s); |
| 228 } | 226 } |
| 229 return pass(p); | 227 return pass(p); |
| 230 } | 228 } |
| 231 } | 229 } |
| OLD | NEW |