| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 String getPlatformOutDir() { | 5 String getPlatformOutDir() { |
| 6 var os = new Platform().operatingSystem(); | 6 var os = new Platform().operatingSystem(); |
| 7 if (os == 'linux') return 'out'; | 7 if (os == 'linux') return 'out/'; |
| 8 if (os == 'macos') return 'xcodebuild'; | 8 if (os == 'macos') return 'xcodebuild/'; |
| 9 return ''; // Windows. | 9 return ''; // Windows. |
| 10 } | 10 } |
| 11 | 11 |
| 12 String getPlatformExecutableExtension() { |
| 13 var os = new Platform().operatingSystem(); |
| 14 if (os == 'windows') return '.exe'; |
| 15 return ''; // Linux and Mac OS. |
| 16 } |
| 17 |
| 12 String getProcessTestFileName() { | 18 String getProcessTestFileName() { |
| 13 var outDir = getPlatformOutDir(); | 19 var outDir = getPlatformOutDir(); |
| 14 var names = ['$outDir/Release_ia32/process_test', | 20 var extension = getPlatformExecutableExtension(); |
| 15 '$outDir/Debug_ia32/process_test']; | 21 var names = ['${outDir}Release_ia32/process_test$extension', |
| 22 '${outDir}Debug_ia32/process_test$extension']; |
| 16 | 23 |
| 17 for (var name in names) { | 24 for (var name in names) { |
| 18 if (new File(name).existsSync()) { | 25 if (new File(name).existsSync()) { |
| 19 return name; | 26 return name; |
| 20 } | 27 } |
| 21 } | 28 } |
| 22 Expect.fail('Could not find the process_test executable.'); | 29 Expect.fail('Could not find the process_test executable.'); |
| 23 } | 30 } |
| 24 | 31 |
| 25 String getDartFileName() { | 32 String getDartFileName() { |
| 26 var outDir = getPlatformOutDir(); | 33 var outDir = getPlatformOutDir(); |
| 27 var names = ['$outDir/Release_ia32/dart', | 34 var extension = getPlatformExecutableExtension(); |
| 28 '$outDir/Debug_ia32/dart']; | 35 var names = ['${outDir}Release_ia32/dart$extension', |
| 36 '${outDir}Debug_ia32/dart$extension']; |
| 29 | 37 |
| 30 for (var name in names) { | 38 for (var name in names) { |
| 31 if (new File(name).existsSync()) { | 39 if (new File(name).existsSync()) { |
| 32 return name; | 40 return name; |
| 33 } | 41 } |
| 34 } | 42 } |
| 35 Expect.fail('Could not find the dart executable.'); | 43 Expect.fail('Could not find the dart executable.'); |
| 36 } | 44 } |
| OLD | NEW |