@@ -35,7 +35,7 @@ void verify(String exePath, {String altPath}) {
3535 }
3636
3737 var result = processResult.stdout.trim ();
38- expectEquals (Platform .executable , result);
38+ expectEquals (Platform .resolvedExecutable , result);
3939}
4040
4141void testDartExecShouldNotBeInCurrentDir () {
@@ -51,20 +51,20 @@ void testShouldSucceedWithEmptyPathEnvironment() {
5151}
5252
5353void testShouldSucceedWithSourcePlatformExecutable () {
54- verify (Platform .executable );
54+ verify (Platform .resolvedExecutable );
5555}
5656
5757void testExeSymLinked (Directory dir) {
5858 var dirUri = new Uri .directory (dir.path);
5959 var link = new Link .fromUri (dirUri.resolve ('dart_exe_link' ));
60- link.createSync (Platform .executable );
60+ link.createSync (Platform .resolvedExecutable );
6161 verify (link.path);
6262}
6363
6464void testPathToDirWithExeSymLinked (Directory dir) {
6565 var dirUri = new Uri .directory (dir.path);
6666 var link = new Link .fromUri (dirUri.resolve ('dart_exe_link' ));
67- link.createSync (Platform .executable );
67+ link.createSync (Platform .resolvedExecutable );
6868 verify ('dart_exe_link' , altPath: dir.path);
6969}
7070
@@ -75,7 +75,7 @@ void testExeDirSymLinked(Directory dir) {
7575 var linkDirUri = dirUri.resolve ('dart_bin_dir_link' );
7676 var link = new Link .fromUri (linkDirUri);
7777
78- var exeFile = new File (Platform .executable );
78+ var exeFile = new File (Platform .resolvedExecutable );
7979
8080 link.createSync (exeFile.parent.path);
8181
@@ -91,15 +91,15 @@ void testPathPointsToSymLinkedSDKPath(Directory dir) {
9191 var linkDirUri = dirUri.resolve ('dart_bin_dir_link' );
9292 var link = new Link .fromUri (linkDirUri);
9393
94- var exeFile = new File (Platform .executable );
94+ var exeFile = new File (Platform .resolvedExecutable );
9595
9696 link.createSync (exeFile.parent.path);
9797
9898 verify (platformExeName, altPath: link.path);
9999}
100100
101101void testPathToSDKDir () {
102- var exeFile = new File (Platform .executable );
102+ var exeFile = new File (Platform .resolvedExecutable );
103103 var binDirPath = exeFile.parent.path;
104104
105105 verify (platformExeName, altPath: binDirPath);
@@ -115,15 +115,19 @@ void withTempDir(void test(Directory dir)) {
115115}
116116
117117String get platformExeName {
118- var raw = new Uri .file (Platform .executable );
118+ var raw = new Uri .file (Platform .resolvedExecutable );
119119 return raw.pathSegments.last;
120120}
121121
122122String get scriptPath => Platform .script.toFilePath ();
123123
124124void 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.
125129 if (Platform .environment.containsKey (_SCRIPT_KEY )) {
126- print (Platform .executable );
130+ print (Platform .resolvedExecutable );
127131 return ;
128132 }
129133
0 commit comments