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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 10850034: Rename BadNumberFormatException -> FormatException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/tests/pub/pubspec_test.dart ('k') | utils/tests/pub/version_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index 852a64af63566eace47b7a2dd2abbd17450f3cfb..42db9d348d76f5885f7114e0292f8b2cbfb846d8 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -247,20 +247,23 @@ void schedulePub([List<String> args, Pattern output, Pattern error,
String pathInSandbox(path) => join(getFullPath(sandboxDir), path);
return ensureDir(pathInSandbox(appPath)).chain((_) {
- // Find a dart executable we can use to run pub. Uses the one that the
- // test infrastructure uses. We are not using new Options.executable here
- // because that gets confused if you invoked Dart through a shell script.
- var scriptDir = new File(new Options().script).directorySync().path;
- var platform = Platform.operatingSystem;
- var dartBin = join(scriptDir, '../../../tools/testing/bin/$platform/dart');
+ // Find a Dart executable we can use to spawn. Use the same one that was
+ // used to run this script itself.
+ var dartBin = new Options().executable;
+
+ // If the executable looks like a path, get its full path. That way we
+ // can still find it when we spawn it with a different working directory.
+ if (dartBin.contains(Platform.pathSeparator)) {
+ dartBin = new File(dartBin).fullPathSync();
+ }
- if (platform == 'windows') dartBin = '$dartBin.exe';
+ var scriptDir = new File(new Options().script).directorySync().path;
// Find the main pub entrypoint.
var pubPath = fs.joinPaths(scriptDir, '../../pub/pub.dart');
var dartArgs =
- ['--enable-type-checks', '--enable-asserts', pubPath, '--trace'];
+ ['--enable-type-checks', '--enable-asserts', pubPath, '--trace'];
dartArgs.addAll(args);
var environment = new Map.from(Platform.environment);
« no previous file with comments | « utils/tests/pub/pubspec_test.dart ('k') | utils/tests/pub/version_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698