| 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 #library("test_runner"); | 5 #library("test_runner"); |
| 6 | 6 |
| 7 | 7 |
| 8 #import("status_file_parser.dart"); | 8 #import("status_file_parser.dart"); |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * Classes and methods for executing tests. | 11 * Classes and methods for executing tests. |
| 12 * | 12 * |
| 13 * This module includes: | 13 * This module includes: |
| 14 * - Managing parallel execution of tests, including timeout checks. | 14 * - Managing parallel execution of tests, including timeout checks. |
| 15 * - Evaluating the output of each test as pass/fail/crash/timeout. | 15 * - Evaluating the output of each test as pass/fail/crash/timeout. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 final int NO_TIMEOUT = 0; | 18 final int NO_TIMEOUT = 0; |
| 19 | 19 |
| 20 String getDartShellFileName() { | 20 |
| 21 var names = ["out/Debug_ia32/dart_bin", | 21 String getBuildDir(Map configuration) { |
| 22 "out/Release_ia32/dart_bin", | 22 var buildDir = ''; |
| 23 "xcodebuild/Debug_ia32/dart_bin", | 23 var os = configuration['os']; |
| 24 "xcodebuild/Release_ia32/dart_bin", | 24 if (os == 'linux') { |
| 25 "Debug_ia32/dart_bin.exe", | 25 buildDir = 'out/'; |
| 26 "Release_ia32/dart_bin.exe"]; | 26 } else if (os == 'macos') { |
| 27 for (var name in names) { | 27 buildDir = 'xcodebuild/'; |
| 28 if (new File(name).existsSync()) { | |
| 29 return name; | |
| 30 } | |
| 31 } | 28 } |
| 32 Expect.fail("Cound not find the Dart shell executable."); | 29 buildDir += (configuration['mode'] == 'debug') ? 'Debug_' : 'Release_'; |
| 30 buildDir += configuration['architecture'] + '/'; |
| 31 return buildDir; |
| 33 } | 32 } |
| 34 | 33 |
| 35 | 34 |
| 35 String getExecutableName(Map configuration) { |
| 36 if (configuration['component'] == 'vm') { |
| 37 return 'dart_bin'; |
| 38 } else if (configuration['component'] == 'dartc') { |
| 39 return 'dartc'; |
| 40 } else { |
| 41 throw "Unknown executable for: ${configuration['component']}"; |
| 42 } |
| 43 } |
| 44 |
| 45 |
| 46 String getDartShellFileName(Map configuration) { |
| 47 return getBuildDir(configuration) + getExecutableName(configuration); |
| 48 } |
| 49 |
| 50 |
| 36 class TestCase { | 51 class TestCase { |
| 37 String executablePath; | 52 String executablePath; |
| 38 List<String> arguments; | 53 List<String> arguments; |
| 39 String commandLine; | 54 String commandLine; |
| 40 String displayName; | 55 String displayName; |
| 41 TestOutput output; | 56 TestOutput output; |
| 42 Set<String> expectedOutcomes; | 57 Set<String> expectedOutcomes; |
| 43 Function completedHandler; | 58 Function completedHandler; |
| 44 | 59 |
| 45 TestCase(this.displayName, this.executablePath, this.arguments, | 60 TestCase(this.displayName, this.executablePath, this.arguments, |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 new RunningProcess(test, 60).start(); | 189 new RunningProcess(test, 60).start(); |
| 175 numProcesses++; | 190 numProcesses++; |
| 176 } | 191 } |
| 177 } | 192 } |
| 178 | 193 |
| 179 runTest(TestCase test) { | 194 runTest(TestCase test) { |
| 180 tests.add(test); | 195 tests.add(test); |
| 181 tryRunTest(); | 196 tryRunTest(); |
| 182 } | 197 } |
| 183 } | 198 } |
| OLD | NEW |