Index: pkg/kernel/test/closures/suite.dart |
diff --git a/pkg/kernel/test/closures/suite.dart b/pkg/kernel/test/closures/suite.dart |
index fdb8c5cb03169d7ab39187b4988948a2b9ebfea0..9748f3acda9c3c73f959d5f305d6b80d522cca6a 100644 |
--- a/pkg/kernel/test/closures/suite.dart |
+++ b/pkg/kernel/test/closures/suite.dart |
@@ -4,20 +4,19 @@ |
library test.kernel.closures.suite; |
+import 'dart:io' show File; |
+ |
import 'dart:async' show Future; |
import 'package:kernel/core_types.dart' show CoreTypes; |
import 'package:testing/testing.dart' |
- show Chain, ChainContext, Result, Step, runMe; |
+ show Chain, ChainContext, Result, Step, runMe, StdioProcess; |
import 'package:kernel/ast.dart' show Program, Library; |
import 'package:kernel/target/targets.dart' show Target; |
-import 'package:kernel/transformations/closure_conversion.dart' |
- as closure_conversion; |
- |
import 'package:front_end/src/fasta/testing/kernel_chain.dart' |
show |
Print, |
@@ -28,6 +27,12 @@ import 'package:front_end/src/fasta/testing/kernel_chain.dart' |
Compile, |
CompileContext; |
+import 'package:kernel/transformations/closure_conversion.dart' |
+ as closure_conversion; |
+ |
+import 'package:front_end/src/fasta/testing/patched_sdk_location.dart' |
+ show computePatchedSdk, computeDartVm; |
+ |
const String STRONG_MODE = " strong mode "; |
class ClosureConversionContext extends ChainContext implements CompileContext { |
@@ -36,6 +41,8 @@ class ClosureConversionContext extends ChainContext implements CompileContext { |
final List<Step> steps; |
+ Program platform; |
+ |
ClosureConversionContext(this.strongMode, bool updateExpectations) |
: steps = <Step>[ |
const Compile(), |
@@ -49,6 +56,7 @@ class ClosureConversionContext extends ChainContext implements CompileContext { |
const WriteDill(), |
const ReadDill(), |
// TODO(29143): add `Run` step when Vectors are added to VM. |
+ //const Run(), |
]; |
static Future<ClosureConversionContext> create( |
@@ -86,4 +94,24 @@ class ClosureConversion |
} |
} |
+class Run extends Step<Uri, int, ClosureConversionContext> { |
+ const Run(); |
+ |
+ String get name => "run"; |
+ |
+ Future<Result<int>> run(Uri uri, ClosureConversionContext context) async { |
+ final File generated = new File.fromUri(uri); |
+ try { |
+ Uri sdk = await computePatchedSdk(); |
+ Uri vm = computeDartVm(sdk); |
+ final StdioProcess process = await StdioProcess |
+ .run(vm.toFilePath(), [generated.path, "Hello, World!"]); |
+ print(process.output); |
+ return process.toResult(); |
+ } finally { |
+ generated.parent.delete(recursive: true); |
+ } |
+ } |
+} |
+ |
main(List<String> arguments) => runMe(arguments, createContext, "testing.json"); |