Chromium Code Reviews| 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; |
| +} |