OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // | 4 // |
5 // Process test program to test process communication. | 5 // Process test program to test process communication. |
6 | 6 |
7 library PlatformExecutableTest; | 7 library PlatformExecutableTest; |
8 | 8 |
9 import "dart:io"; | 9 import "dart:io"; |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 var result = processResult.stdout.trim(); | 37 var result = processResult.stdout.trim(); |
38 expectEquals(Platform.executable, result); | 38 expectEquals(Platform.executable, result); |
39 } | 39 } |
40 | 40 |
41 void testDartExecShouldNotBeInCurrentDir() { | 41 void testDartExecShouldNotBeInCurrentDir() { |
42 var type = FileSystemEntity.typeSync(platformExeName); | 42 var type = FileSystemEntity.typeSync(platformExeName); |
43 expectEquals(FileSystemEntityType.NOT_FOUND, type); | 43 expectEquals(FileSystemEntityType.NOT_FOUND, type); |
44 } | 44 } |
45 | 45 |
46 void testShouldSucceedWithEmptyPathEnvironment() { | 46 void testShouldSucceedWithEmptyPathEnvironment() { |
47 Process.runSync(platformExeName, ['--version'], | 47 var command = Platform.isWindows ? 'dir' : 'ls'; |
| 48 Process.runSync(command, [], |
48 includeParentEnvironment: false, | 49 includeParentEnvironment: false, |
49 environment: {_SCRIPT_KEY: 'yes', 'PATH': ''}); | 50 environment: {_SCRIPT_KEY: 'yes', 'PATH': ''}); |
50 } | 51 } |
51 | 52 |
52 void testShouldSucceedWithSourcePlatformExecutable() { | 53 void testShouldSucceedWithSourcePlatformExecutable() { |
53 //print('*** Running normally'); | 54 //print('*** Running normally'); |
54 verify(Platform.executable); | 55 verify(Platform.executable); |
55 } | 56 } |
56 | 57 |
57 void testExeSymLinked(Directory dir) { | 58 void testExeSymLinked(Directory dir) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 135 |
135 testDartExecShouldNotBeInCurrentDir(); | 136 testDartExecShouldNotBeInCurrentDir(); |
136 testShouldSucceedWithSourcePlatformExecutable(); /// 00: ok | 137 testShouldSucceedWithSourcePlatformExecutable(); /// 00: ok |
137 withTempDir(testExeSymLinked); /// 01: ok | 138 withTempDir(testExeSymLinked); /// 01: ok |
138 withTempDir(testExeDirSymLinked); /// 02: ok | 139 withTempDir(testExeDirSymLinked); /// 02: ok |
139 testPathToSDKDir(); /// 03: ok | 140 testPathToSDKDir(); /// 03: ok |
140 withTempDir(testPathPointsToSymLinkedSDKPath); /// 04: ok | 141 withTempDir(testPathPointsToSymLinkedSDKPath); /// 04: ok |
141 withTempDir(testPathToDirWithExeSymLinked); /// 05: ok | 142 withTempDir(testPathToDirWithExeSymLinked); /// 05: ok |
142 testShouldSucceedWithEmptyPathEnvironment(); /// 06: ok | 143 testShouldSucceedWithEmptyPathEnvironment(); /// 06: ok |
143 } | 144 } |
OLD | NEW |