| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 185 |
| 186 bool get isRuntime => true; | 186 bool get isRuntime => true; |
| 187 | 187 |
| 188 Future<Result<int>> run(Uri uri, FastaContext context) async { | 188 Future<Result<int>> run(Uri uri, FastaContext context) async { |
| 189 if (context.platformUri == null) { | 189 if (context.platformUri == null) { |
| 190 throw "Executed `Run` step before initializing the context."; | 190 throw "Executed `Run` step before initializing the context."; |
| 191 } | 191 } |
| 192 File generated = new File.fromUri(uri); | 192 File generated = new File.fromUri(uri); |
| 193 StdioProcess process; | 193 StdioProcess process; |
| 194 try { | 194 try { |
| 195 var platformDill = context.platformUri.toFilePath(); | 195 var sdkPath = context.sdk.toFilePath(); |
| 196 var args = ['--platform=$platformDill', generated.path, "Hello, World!"]; | 196 var args = [ |
| 197 '--kernel-binaries=$sdkPath', |
| 198 generated.path, |
| 199 "Hello, World!" |
| 200 ]; |
| 197 process = await StdioProcess.run(context.vm.toFilePath(), args); | 201 process = await StdioProcess.run(context.vm.toFilePath(), args); |
| 198 print(process.output); | 202 print(process.output); |
| 199 } finally { | 203 } finally { |
| 200 generated.parent.delete(recursive: true); | 204 generated.parent.delete(recursive: true); |
| 201 } | 205 } |
| 202 return process.toResult(); | 206 return process.toResult(); |
| 203 } | 207 } |
| 204 } | 208 } |
| 205 | 209 |
| 206 class Outline extends Step<TestDescription, Program, FastaContext> { | 210 class Outline extends Step<TestDescription, Program, FastaContext> { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 } | 316 } |
| 313 } | 317 } |
| 314 | 318 |
| 315 void performGlobalTransformations(CoreTypes coreTypes, Program program, | 319 void performGlobalTransformations(CoreTypes coreTypes, Program program, |
| 316 {void logger(String msg)}) { | 320 {void logger(String msg)}) { |
| 317 if (enabled) { | 321 if (enabled) { |
| 318 super.performGlobalTransformations(coreTypes, program, logger: logger); | 322 super.performGlobalTransformations(coreTypes, program, logger: logger); |
| 319 } | 323 } |
| 320 } | 324 } |
| 321 } | 325 } |
| OLD | NEW |