| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if (testCase is !BrowserTestCase) return (exitCode != 0 && !hasCrashed); | 154 if (testCase is !BrowserTestCase) return (exitCode != 0 && !hasCrashed); |
| 155 | 155 |
| 156 // Browser case: | 156 // Browser case: |
| 157 // Browser tests fail unless stdout contains | 157 // Browser tests fail unless stdout contains |
| 158 // 'Content-Type: text/plain\nPASS'. | 158 // 'Content-Type: text/plain\nPASS'. |
| 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 (exitCode != 0 && !hasCrashed); | 162 return (exitCode != 0 && !hasCrashed); |
| 163 } | 163 } |
| 164 // If the browser test failed, it may have been because DumpRenderTree | 164 previous_line = line; |
| 165 // and the virtual framebuffer X server didn't hook up. | 165 } |
| 166 |
| 167 // If the browser test failed, it may have been because DumpRenderTree |
| 168 // and the virtual framebuffer X server didn't hook up. |
| 169 for (String line in stderr) { |
| 166 if (line.contains('Gtk-WARNING **: cannot open display: :99')) { | 170 if (line.contains('Gtk-WARNING **: cannot open display: :99')) { |
| 167 // If we get the X server error, return the expected value | 171 // If we get the X server error, return the expected value |
| 168 // We cannot restart the test from here. Issue dart:1135 is filed. | 172 // We cannot restart the test from here. Issue dart:1135 is filed. |
| 169 return testCase.isNegative; | 173 return testCase.isNegative; |
| 170 } | 174 } |
| 171 previous_line = line; | |
| 172 } | 175 } |
| 173 return true; | 176 return true; |
| 174 } | 177 } |
| 175 | 178 |
| 176 // Reverse result of a negative test. | 179 // Reverse result of a negative test. |
| 177 bool get hasFailed() => (testCase.isNegative ? !didFail : didFail); | 180 bool get hasFailed() => (testCase.isNegative ? !didFail : didFail); |
| 178 } | 181 } |
| 179 | 182 |
| 180 | 183 |
| 181 class RunningProcess { | 184 class RunningProcess { |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 test.displayName != 'dartc/junit_tests') { | 504 test.displayName != 'dartc/junit_tests') { |
| 502 _ensureDartcBatchRunnersStarted(test.executablePath); | 505 _ensureDartcBatchRunnersStarted(test.executablePath); |
| 503 _getDartcBatchRunnerProcess().startTest(test); | 506 _getDartcBatchRunnerProcess().startTest(test); |
| 504 } else { | 507 } else { |
| 505 new RunningProcess(test).start(); | 508 new RunningProcess(test).start(); |
| 506 } | 509 } |
| 507 _numProcesses++; | 510 _numProcesses++; |
| 508 } | 511 } |
| 509 } | 512 } |
| 510 } | 513 } |
| OLD | NEW |