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

Unified Diff: pkg/fasta/lib/src/run.dart

Issue 2634453004: Fasta infrastructure. (Closed)
Patch Set: Address review comments. Created 3 years, 11 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/fasta/lib/src/outline.dart ('k') | pkg/fasta/lib/src/target.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fasta/lib/src/run.dart
diff --git a/pkg/fasta/lib/src/run.dart b/pkg/fasta/lib/src/run.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f4c18a2fa3b770355c0223b3a39542da9c3c2ed9
--- /dev/null
+++ b/pkg/fasta/lib/src/run.dart
@@ -0,0 +1,42 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE.md file.
+
+library fasta.run;
+
+import 'dart:async' show
+ Future;
+
+import 'dart:io' show
+ stdout;
+
+import 'package:testing/testing.dart' show
+ StdioProcess;
+
+import '../testing/kernel_chain.dart' show
+ TestContext;
+
+import 'compiler_command_line.dart' show
+ CompilerCommandLine;
+
+Future<int> run(Uri uri, CompilerCommandLine cl) async {
+ Uri dartVm;
+
+ Future<TestContext> constructor(
+ suite, Map<String, String> environment, String sdk, Uri vm,
+ Uri packages, bool strongMode, dartSdk, bool updateExpectations) {
+ dartVm = vm;
+ return null;
+ }
+ // TODO(ahe): Using [TestContext] to compute a value for [dartVm]. Make the
+ // API simpler.
+ await TestContext.create(null, <String, String>{}, constructor);
+ List<String> arguments = <String>["${uri.toFilePath()}"]
+ ..addAll(cl.arguments.skip(1));
+ if (cl.verbose) {
+ print("Running ${dartVm.toFilePath()} ${arguments.join(' ')}");
+ }
+ StdioProcess result = await StdioProcess.run(dartVm.toFilePath(), arguments);
+ stdout.write(result.output);
+ return result.exitCode;
+}
« no previous file with comments | « pkg/fasta/lib/src/outline.dart ('k') | pkg/fasta/lib/src/target.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698