| 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 #import("status_file_parser.dart"); | 7 #import("status_file_parser.dart"); |
| 8 #import("test_progress.dart"); | 8 #import("test_progress.dart"); |
| 9 #import("test_suite.dart"); | 9 #import("test_suite.dart"); |
| 10 | 10 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 TestOutput(this.testCase, this.exitCode, this.timedOut, this.stdout, | 120 TestOutput(this.testCase, this.exitCode, this.timedOut, this.stdout, |
| 121 this.stderr, this.time) { | 121 this.stderr, this.time) { |
| 122 testCase.output = this; | 122 testCase.output = this; |
| 123 } | 123 } |
| 124 | 124 |
| 125 String get result() => | 125 String get result() => |
| 126 hasCrashed ? CRASH : (hasTimedOut ? TIMEOUT : (hasFailed ? FAIL : PASS)); | 126 hasCrashed ? CRASH : (hasTimedOut ? TIMEOUT : (hasFailed ? FAIL : PASS)); |
| 127 | 127 |
| 128 bool get unexpectedOutput() => !testCase.expectedOutcomes.contains(result); | 128 bool get unexpectedOutput() => !testCase.expectedOutcomes.contains(result); |
| 129 | 129 |
| 130 // The Java dartc runner exits with code 253 in case of unhandled | |
| 131 // exceptions. | |
| 132 // The VM uses std::abort to terminate on asserts. | |
| 133 // std::abort terminates with exit code 3 on Windows. | |
| 134 bool get hasCrashed() { | 130 bool get hasCrashed() { |
| 135 if (new Platform().operatingSystem() == 'windows') { | 131 if (new Platform().operatingSystem() == 'windows') { |
| 132 // The VM uses std::abort to terminate on asserts. |
| 133 // std::abort terminates with exit code 3 on Windows. |
| 136 if (exitCode == 3) { | 134 if (exitCode == 3) { |
| 137 return !timedOut; | 135 return !timedOut; |
| 138 } | 136 } |
| 139 return (!timedOut && | 137 return (!timedOut && (exitCode < 0) && ((0x3FFFFF00 & exitCode) == 0)); |
| 140 (exitCode != -1) && | |
| 141 (exitCode < 0) && | |
| 142 ((0x3FFFFF00 & exitCode) == 0)); | |
| 143 } | 138 } |
| 144 return (!timedOut && | 139 // The Java dartc runner exits with code 253 in case of unhandled |
| 145 (exitCode != -1) && | 140 // exceptions. |
| 146 ((exitCode < 0) || (exitCode == 253))); | 141 return (!timedOut && ((exitCode < 0) || (exitCode == 253))); |
| 147 } | 142 } |
| 148 | 143 |
| 149 bool get hasTimedOut() => timedOut; | 144 bool get hasTimedOut() => timedOut; |
| 150 | 145 |
| 151 bool get didFail() { | 146 bool get didFail() { |
| 152 if (exitCode != 0 && !hasCrashed) return true; | 147 if (exitCode != 0 && !hasCrashed) return true; |
| 153 | 148 |
| 154 // Browser tests fail unless stdout contains | 149 // Browser tests fail unless stdout contains |
| 155 // 'Content-Type: text/plain\nPASS'. | 150 // 'Content-Type: text/plain\nPASS'. |
| 156 if (testCase is !BrowserTestCase) return false; | 151 if (testCase is !BrowserTestCase) return false; |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 if (test.configuration['component'] == 'dartc') { | 465 if (test.configuration['component'] == 'dartc') { |
| 471 _ensureDartcBatchRunnersStarted(test.executablePath); | 466 _ensureDartcBatchRunnersStarted(test.executablePath); |
| 472 _getDartcBatchRunnerProcess().startTest(test); | 467 _getDartcBatchRunnerProcess().startTest(test); |
| 473 } else { | 468 } else { |
| 474 new RunningProcess(test).start(); | 469 new RunningProcess(test).start(); |
| 475 } | 470 } |
| 476 _numProcesses++; | 471 _numProcesses++; |
| 477 } | 472 } |
| 478 } | 473 } |
| 479 } | 474 } |
| OLD | NEW |