@@ -35,7 +35,7 @@ void verify(String exePath, {String altPath}) {
35
35
}
36
36
37
37
var result = processResult.stdout.trim ();
38
- expectEquals (Platform .executable , result);
38
+ expectEquals (Platform .resolvedExecutable , result);
39
39
}
40
40
41
41
void testDartExecShouldNotBeInCurrentDir () {
@@ -51,20 +51,20 @@ void testShouldSucceedWithEmptyPathEnvironment() {
51
51
}
52
52
53
53
void testShouldSucceedWithSourcePlatformExecutable () {
54
- verify (Platform .executable );
54
+ verify (Platform .resolvedExecutable );
55
55
}
56
56
57
57
void testExeSymLinked (Directory dir) {
58
58
var dirUri = new Uri .directory (dir.path);
59
59
var link = new Link .fromUri (dirUri.resolve ('dart_exe_link' ));
60
- link.createSync (Platform .executable );
60
+ link.createSync (Platform .resolvedExecutable );
61
61
verify (link.path);
62
62
}
63
63
64
64
void testPathToDirWithExeSymLinked (Directory dir) {
65
65
var dirUri = new Uri .directory (dir.path);
66
66
var link = new Link .fromUri (dirUri.resolve ('dart_exe_link' ));
67
- link.createSync (Platform .executable );
67
+ link.createSync (Platform .resolvedExecutable );
68
68
verify ('dart_exe_link' , altPath: dir.path);
69
69
}
70
70
@@ -75,7 +75,7 @@ void testExeDirSymLinked(Directory dir) {
75
75
var linkDirUri = dirUri.resolve ('dart_bin_dir_link' );
76
76
var link = new Link .fromUri (linkDirUri);
77
77
78
- var exeFile = new File (Platform .executable );
78
+ var exeFile = new File (Platform .resolvedExecutable );
79
79
80
80
link.createSync (exeFile.parent.path);
81
81
@@ -91,15 +91,15 @@ void testPathPointsToSymLinkedSDKPath(Directory dir) {
91
91
var linkDirUri = dirUri.resolve ('dart_bin_dir_link' );
92
92
var link = new Link .fromUri (linkDirUri);
93
93
94
- var exeFile = new File (Platform .executable );
94
+ var exeFile = new File (Platform .resolvedExecutable );
95
95
96
96
link.createSync (exeFile.parent.path);
97
97
98
98
verify (platformExeName, altPath: link.path);
99
99
}
100
100
101
101
void testPathToSDKDir () {
102
- var exeFile = new File (Platform .executable );
102
+ var exeFile = new File (Platform .resolvedExecutable );
103
103
var binDirPath = exeFile.parent.path;
104
104
105
105
verify (platformExeName, altPath: binDirPath);
@@ -115,15 +115,19 @@ void withTempDir(void test(Directory dir)) {
115
115
}
116
116
117
117
String get platformExeName {
118
- var raw = new Uri .file (Platform .executable );
118
+ var raw = new Uri .file (Platform .resolvedExecutable );
119
119
return raw.pathSegments.last;
120
120
}
121
121
122
122
String get scriptPath => Platform .script.toFilePath ();
123
123
124
124
void main () {
125
+ // The same script is used for both running the tests and as for starting
126
+ // child verifying the value of Platform.resolvedExecutable. If the
127
+ // environment variable _SCRIPT_KEY is set this is a child process which
128
+ // should print the value of Platform.resolvedExecutable.
125
129
if (Platform .environment.containsKey (_SCRIPT_KEY )) {
126
- print (Platform .executable );
130
+ print (Platform .resolvedExecutable );
127
131
return ;
128
132
}
129
133
0 commit comments