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

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

Issue 2634453004: Fasta infrastructure. (Closed)
Patch Set: 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
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..239a1abe165e409bcfd4d33452b077e506cc9c5c
--- /dev/null
+++ b/pkg/fasta/lib/src/run.dart
@@ -0,0 +1,40 @@
+// 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;
+ }
+ await TestContext.create(null, <String, String>{}, constructor);
Johnni Winther 2017/01/16 09:47:46 Add comment that this is to fetch the [dartVm] val
ahe 2017/01/16 12:07:04 Done.
+ 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;
+}

Powered by Google App Engine
This is Rietveld 408576698