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

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

Issue 1152333005: fix windows bots with Platform.executable test (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/platform_executable_test.dart
diff --git a/tests/standalone/io/platform_executable_test.dart b/tests/standalone/io/platform_executable_test.dart
index 60dd47dad1013e4992d2137cf785e26d2f4e79fb..0340e64faca0bf5058de01848f923c8f732fffa3 100644
--- a/tests/standalone/io/platform_executable_test.dart
+++ b/tests/standalone/io/platform_executable_test.dart
@@ -8,6 +8,8 @@ library PlatformExecutableTest;
import "dart:io";
+const _SCRIPT_KEY = '_test_script';
+
void expectEquals(a, b) {
if (a != b) {
throw 'Expected: $a\n'
@@ -16,7 +18,7 @@ void expectEquals(a, b) {
}
void verify(String exePath, {String altPath}) {
- var env = {'SCRIPT': 'yes'};
+ var env = {_SCRIPT_KEY: 'yes'};
if (altPath != null) {
env['PATH'] = altPath;
}
@@ -44,13 +46,16 @@ void testDartExecShouldNotBeInCurrentDir() {
void testShouldFailOutsidePath() {
var threw = false;
try {
- Process.runSync(platformExeName, [scriptPath],
- includeParentEnvironment: false, environment: {'SCRIPT': 'yes'});
+ Process.runSync(platformExeName, [platformExeName],
Søren Gjesse 2015/05/26 07:27:54 Why are you passing [platformExeName] here?
+ includeParentEnvironment: false, environment: {_SCRIPT_KEY: 'yes'});
} catch (_) {
threw = true;
}
- expectEquals(true, threw);
+ if (!threw) {
+ throw 'Expected running the dart executable – "$platformExeName" without'
+ ' the parent environment or path to fail.';
+ }
}
void testShouldSucceedWithSourcePlatformExecutable() {
@@ -131,7 +136,7 @@ String get platformExeName {
String get scriptPath => Platform.script.toFilePath();
void main() {
- if (Platform.environment.containsKey('SCRIPT')) {
+ if (Platform.environment.containsKey(_SCRIPT_KEY)) {
print(Platform.executable);
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698