| 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 | 9 |
| 10 /** | 10 /** |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 testCase.output = this; | 64 testCase.output = this; |
| 65 } | 65 } |
| 66 | 66 |
| 67 String get result() => | 67 String get result() => |
| 68 hasCrashed ? CRASH : (hasTimedOut ? TIMEOUT : (hasFailed ? FAIL : PASS)); | 68 hasCrashed ? CRASH : (hasTimedOut ? TIMEOUT : (hasFailed ? FAIL : PASS)); |
| 69 | 69 |
| 70 bool get unexpectedOutput() => !testCase.expectedOutcomes.contains(result); | 70 bool get unexpectedOutput() => !testCase.expectedOutcomes.contains(result); |
| 71 | 71 |
| 72 // The Java dartc runner exits with code 253 in case of unhandles | 72 // The Java dartc runner exits with code 253 in case of unhandles |
| 73 // exceptions. | 73 // exceptions. |
| 74 bool get hasCrashed() => | 74 // The VM uses std::abort to terminate on asserts. |
| 75 !timedOut && (exitCode != -1) && ((exitCode < 0) || (exitCode == 253)); | 75 // std::abort terminates with exit code 3 on Windows. |
| 76 bool get hasCrashed() { |
| 77 if (new Platform().operatingSystem() == 'windows') { |
| 78 if (exitCode == 3) { |
| 79 return !timedOut; |
| 80 } |
| 81 return (!timedOut && |
| 82 (exitCode != -1) && |
| 83 (exitCode < 0) && |
| 84 ((0x3FFFFF00 & exitCode) == 0)); |
| 85 } |
| 86 return (!timedOut && |
| 87 (exitCode != -1) && |
| 88 ((exitCode < 0) || (exitCode == 253))); |
| 89 } |
| 76 | 90 |
| 77 bool get hasTimedOut() => timedOut; | 91 bool get hasTimedOut() => timedOut; |
| 78 | 92 |
| 79 bool get didFail() => exitCode != 0 && !hasCrashed; | 93 bool get didFail() => exitCode != 0 && !hasCrashed; |
| 80 | 94 |
| 81 // Reverse result of a negative test. | 95 // Reverse result of a negative test. |
| 82 bool get hasFailed() => (testCase.isNegative ? !didFail : didFail); | 96 bool get hasFailed() => (testCase.isNegative ? !didFail : didFail); |
| 83 } | 97 } |
| 84 | 98 |
| 85 | 99 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 numProcesses++; | 192 numProcesses++; |
| 179 } | 193 } |
| 180 } | 194 } |
| 181 | 195 |
| 182 runTest(TestCase test) { | 196 runTest(TestCase test) { |
| 183 progress.testAdded(); | 197 progress.testAdded(); |
| 184 tests.add(test); | 198 tests.add(test); |
| 185 tryRunTest(); | 199 tryRunTest(); |
| 186 } | 200 } |
| 187 } | 201 } |
| OLD | NEW |