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

Side by Side Diff: tests/compiler/dart2js/launch_helper.dart

Issue 2243073002: Fix batch test as well. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix batch test Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « tests/compiler/dart2js/dart2js_batch_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import 'dart:async'; 1 import 'dart:async';
2 import 'dart:io'; 2 import 'dart:io';
3 import 'package:path/path.dart' as path; 3 import 'package:path/path.dart' as path;
4 4
5 Future launchDart2Js(args, 5 List<String> dart2JsCommand(List<String> args) {
6 {bool noStdoutEncoding: false}) {
7 String basePath = path.fromUri(Platform.script); 6 String basePath = path.fromUri(Platform.script);
8 while (path.basename(basePath) != 'sdk') { 7 while (path.basename(basePath) != 'sdk') {
9 basePath = path.dirname(basePath); 8 basePath = path.dirname(basePath);
10 } 9 }
11 String dart2jsPath = path.normalize( 10 String dart2jsPath =
12 path.join(basePath, 'pkg/compiler/lib/src/dart2js.dart')); 11 path.normalize(path.join(basePath, 'pkg/compiler/lib/src/dart2js.dart'));
13 List allArgs = []; 12 List command = <String>[];
14 if (Platform.packageRoot != null) { 13 if (Platform.packageRoot != null) {
15 allArgs.add('--package-root=${Platform.packageRoot}'); 14 command.add('--package-root=${Platform.packageRoot}');
16 } else if (Platform.packageConfig != null) { 15 } else if (Platform.packageConfig != null) {
17 allArgs.add('--packages=${Platform.packageConfig}'); 16 command.add('--packages=${Platform.packageConfig}');
18 } 17 }
19 allArgs.add(dart2jsPath); 18 command.add(dart2jsPath);
20 allArgs.addAll(args); 19 command.addAll(args);
20 return command;
21 }
22
23 Future launchDart2Js(args, {bool noStdoutEncoding: false}) {
21 if (noStdoutEncoding) { 24 if (noStdoutEncoding) {
22 return Process.run(Platform.executable, allArgs, stdoutEncoding: null); 25 return Process.run(Platform.executable, dart2JsCommand(args),
26 stdoutEncoding: null);
23 } else { 27 } else {
24 return Process.run(Platform.executable, allArgs); 28 return Process.run(Platform.executable, dart2JsCommand(args));
25 } 29 }
26 } 30 }
27
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/dart2js_batch_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698