Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1566)

Unified Diff: pkg/kernel/test/closures/suite.dart

Issue 2891053003: Add support for converted closures with explicit contexts to VM (Closed)
Patch Set: Temporarily disable Run step in closures test suite Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/kernel/test/closures/closures.status ('k') | pkg/kernel/testcases/closures/capture_this.dart.expect » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « pkg/kernel/test/closures/closures.status ('k') | pkg/kernel/testcases/closures/capture_this.dart.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698