Chromium Code Reviews| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 return (!timedOut && (exitCode < 0) && ((0x3FFFFF00 & exitCode) == 0)); | 144 return (!timedOut && (exitCode < 0) && ((0x3FFFFF00 & exitCode) == 0)); |
| 145 } | 145 } |
| 146 // The Java dartc runner exits with code 253 in case of unhandled | 146 // The Java dartc runner exits with code 253 in case of unhandled |
| 147 // exceptions. | 147 // exceptions. |
| 148 return (!timedOut && ((exitCode < 0) || (exitCode == 253))); | 148 return (!timedOut && ((exitCode < 0) || (exitCode == 253))); |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool get hasTimedOut() => timedOut; | 151 bool get hasTimedOut() => timedOut; |
| 152 | 152 |
| 153 bool get didFail() { | 153 bool get didFail() { |
| 154 if (exitCode != 0 && !hasCrashed) return true; | 154 if (testCase is !BrowserTestCase) return (exitCode != 0 && !hasCrashed); |
| 155 | 155 |
| 156 // Browser case: | |
| 156 // Browser tests fail unless stdout contains | 157 // Browser tests fail unless stdout contains |
| 157 // 'Content-Type: text/plain\nPASS'. | 158 // 'Content-Type: text/plain\nPASS'. |
| 158 if (testCase is !BrowserTestCase) return false; | |
| 159 String previous_line = ''; | 159 String previous_line = ''; |
| 160 for (String line in stdout) { | 160 for (String line in stdout) { |
| 161 if (line == 'PASS' && previous_line == 'Content-Type: text/plain') { | 161 if (line == 'PASS' && previous_line == 'Content-Type: text/plain') { |
| 162 return false; | 162 return (exitCode != 0 && !hasCrashed); |
| 163 } | 163 } |
| 164 // If the browser test failed, it may have been because DumpRenderTree | 164 // If the browser test failed, it may have been because DumpRenderTree |
| 165 // and the virtual framebuffer X server didn't hook up. So return false | 165 // and the virtual framebuffer X server didn't hook up. |
| 166 // if we get the X server error. Issue dart:1135 is filed. | |
| 167 if (line.contains('Gtk-WARNING **: cannot open display: :99')) { | 166 if (line.contains('Gtk-WARNING **: cannot open display: :99')) { |
|
Siggi Cherem (dart-lang)
2012/01/11 20:55:15
I just saw the failure here:
http://chromegw.corp.
| |
| 168 return false; | 167 // If we get the X server error, return the expected value |
| 168 // We cannot restart the test from here. Issue dart:1135 is filed. | |
| 169 return testCase.isNegative; | |
|
Siggi Cherem (dart-lang)
2012/01/11 18:40:15
could we print a warning to stdout too?
| |
| 169 } | 170 } |
| 170 previous_line = line; | 171 previous_line = line; |
| 171 } | 172 } |
| 172 return true; | 173 return true; |
| 173 } | 174 } |
| 174 | 175 |
| 175 // Reverse result of a negative test. | 176 // Reverse result of a negative test. |
| 176 bool get hasFailed() => (testCase.isNegative ? !didFail : didFail); | 177 bool get hasFailed() => (testCase.isNegative ? !didFail : didFail); |
| 177 } | 178 } |
| 178 | 179 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 500 test.displayName != 'dartc/junit_tests') { | 501 test.displayName != 'dartc/junit_tests') { |
| 501 _ensureDartcBatchRunnersStarted(test.executablePath); | 502 _ensureDartcBatchRunnersStarted(test.executablePath); |
| 502 _getDartcBatchRunnerProcess().startTest(test); | 503 _getDartcBatchRunnerProcess().startTest(test); |
| 503 } else { | 504 } else { |
| 504 new RunningProcess(test).start(); | 505 new RunningProcess(test).start(); |
| 505 } | 506 } |
| 506 _numProcesses++; | 507 _numProcesses++; |
| 507 } | 508 } |
| 508 } | 509 } |
| 509 } | 510 } |
| OLD | NEW |