Chromium Code Reviews| Index: test/io.dart |
| diff --git a/test/io.dart b/test/io.dart |
| index 46b42623f1226ea65e63a6c25e39c99b651c0373..2316c4bab6b06a10b0d41937dbe252f5011bc956 100644 |
| --- a/test/io.dart |
| +++ b/test/io.dart |
| @@ -14,9 +14,9 @@ import 'package:test/src/util/io.dart'; |
| final String packageDir = p.dirname(p.dirname(libraryPath(#test.test.io))); |
| /// The path to the `pub` executable in the current Dart SDK. |
| -final _pubPath = p.join( |
| +final _pubPath = p.absolute(p.join( |
| p.dirname(Platform.executable), |
| - Platform.isWindows ? 'pub.bat' : 'pub'); |
| + Platform.isWindows ? 'pub.bat' : 'pub')); |
| /// Runs the test executable with the package root set properly. |
| ProcessResult runUnittest(List<String> args, {String workingDirectory, |
| @@ -37,10 +37,16 @@ ProcessResult runUnittest(List<String> args, {String workingDirectory, |
| /// Runs Dart. |
| ProcessResult runDart(List<String> args, {String workingDirectory, |
| Map<String, String> environment}) { |
| - var allArgs = Platform.executableArguments.toList()..addAll(args); |
| + var allArgs = Platform.executableArguments.map((arg) { |
| + // The bots use a relative package root, which we need to make absolute if |
|
kevmoo
2015/04/21 22:53:10
want to make this comment more general than just f
nweiz
2015/04/21 22:57:33
Done.
|
| + // we're going to run in a different working directory. |
| + if (!arg.startsWith("--package-root=")) return arg; |
| + return "--package-root=" + |
| + p.absolute(arg.substring("--package-root=".length)); |
| + }).toList()..addAll(args); |
| // TODO(nweiz): Use ScheduledProcess once it's compatible. |
| - return Process.runSync(Platform.executable, allArgs, |
| + return Process.runSync(p.absolute(Platform.executable), allArgs, |
| workingDirectory: workingDirectory, environment: environment); |
| } |