| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 String getPlatformOutDir() { | |
| 6 var os = Platform.operatingSystem(); | |
| 7 if (os == 'linux') return 'out/'; | |
| 8 if (os == 'macos') return 'xcodebuild/'; | |
| 9 return ''; // Windows. | |
| 10 } | |
| 11 | |
| 12 String getPlatformExecutableExtension() { | |
| 13 var os = Platform.operatingSystem(); | |
| 14 if (os == 'windows') return '.exe'; | |
| 15 return ''; // Linux and Mac OS. | |
| 16 } | |
| 17 | |
| 18 String getProcessTestFileName() { | |
| 19 var outDir = getPlatformOutDir(); | |
| 20 var extension = getPlatformExecutableExtension(); | |
| 21 // We do not expose information about the mode or architecture we are testing | |
| 22 // to the tests themselves, so we use any working copy. | |
| 23 var names = ['${outDir}Release_ia32/process_test$extension', | |
| 24 '${outDir}Debug_ia32/process_test$extension', | |
| 25 '${outDir}Release_x64/process_test$extension', | |
| 26 '${outDir}Debug_x64/process_test$extension']; | |
| 27 | |
| 28 for (var name in names) { | |
| 29 if (new File(name).existsSync()) { | |
| 30 return name; | |
| 31 } | |
| 32 } | |
| 33 Expect.fail('Could not find the process_test executable.'); | |
| 34 } | |
| 35 | |
| 36 String getDartFileName() { | |
| 37 var outDir = getPlatformOutDir(); | |
| 38 var extension = getPlatformExecutableExtension(); | |
| 39 // We do not expose information about the mode or architecture we are testing | |
| 40 // to the tests themselves, so we use any working dart shell. | |
| 41 var names = ['${outDir}Release_ia32/dart$extension', | |
| 42 '${outDir}Debug_ia32/dart$extension', | |
| 43 '${outDir}Release_x64/dart$extension', | |
| 44 '${outDir}Debug_x64/dart$extension']; | |
| 45 | |
| 46 for (var name in names) { | |
| 47 if (new File(name).existsSync()) { | |
| 48 return name; | |
| 49 } | |
| 50 } | |
| 51 Expect.fail('Could not find the dart executable.'); | |
| 52 } | |
| OLD | NEW |