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

Unified Diff: tests/standalone/io/process_test_util.dart

Issue 10380026: Add executable to Options interface to get the name of the executable used to execute the script. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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: tests/standalone/io/process_test_util.dart
diff --git a/tests/standalone/io/process_test_util.dart b/tests/standalone/io/process_test_util.dart
index 1de73cb037cd2c69ab416ada04ee5f9a1535454d..61ad729b8240d3207d9c31d6a2f749acf0cad7ae 100644
--- a/tests/standalone/io/process_test_util.dart
+++ b/tests/standalone/io/process_test_util.dart
@@ -2,13 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-String getPlatformOutDir() {
- var os = Platform.operatingSystem;
- if (os == 'linux') return 'out/';
- if (os == 'macos') return 'xcodebuild/';
- return ''; // Windows.
-}
-
String getPlatformExecutableExtension() {
var os = Platform.operatingSystem;
if (os == 'windows') return '.exe';
@@ -16,37 +9,10 @@ String getPlatformExecutableExtension() {
}
String getProcessTestFileName() {
- var outDir = getPlatformOutDir();
- var extension = getPlatformExecutableExtension();
- // We do not expose information about the mode or architecture we are testing
- // to the tests themselves, so we use any working copy.
- var names = ['${outDir}Release_ia32/process_test$extension',
- '${outDir}Debug_ia32/process_test$extension',
- '${outDir}Release_x64/process_test$extension',
- '${outDir}Debug_x64/process_test$extension'];
-
- for (var name in names) {
- if (new File(name).existsSync()) {
- return name;
- }
- }
- Expect.fail('Could not find the process_test executable.');
-}
-
-String getDartFileName() {
- var outDir = getPlatformOutDir();
var extension = getPlatformExecutableExtension();
- // We do not expose information about the mode or architecture we are testing
- // to the tests themselves, so we use any working dart shell.
- var names = ['${outDir}Release_ia32/dart$extension',
- '${outDir}Debug_ia32/dart$extension',
- '${outDir}Release_x64/dart$extension',
- '${outDir}Debug_x64/dart$extension'];
-
- for (var name in names) {
- if (new File(name).existsSync()) {
- return name;
- }
- }
- Expect.fail('Could not find the dart executable.');
+ var executable = new Options().executable;
+ var dirIndex = executable.lastIndexOf('dart$extension');
+ var buffer = new StringBuffer(executable.substring(0, dirIndex));
+ buffer.add('process_test$extension');
+ return buffer.toString();
}

Powered by Google App Engine
This is Rietveld 408576698