| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * Classes and methods for executing tests. | 6 * Classes and methods for executing tests. |
| 7 * | 7 * |
| 8 * This module includes: | 8 * This module includes: |
| 9 * - Managing parallel execution of tests, including timeout checks. | 9 * - Managing parallel execution of tests, including timeout checks. |
| 10 * - Evaluating the output of each test as pass/fail/crash/timeout. | 10 * - Evaluating the output of each test as pass/fail/crash/timeout. |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 */ | 243 */ |
| 244 class RunningProcess { | 244 class RunningProcess { |
| 245 Process process; | 245 Process process; |
| 246 TestCase testCase; | 246 TestCase testCase; |
| 247 bool timedOut = false; | 247 bool timedOut = false; |
| 248 Date startTime; | 248 Date startTime; |
| 249 Timer timeoutTimer; | 249 Timer timeoutTimer; |
| 250 List<String> stdout; | 250 List<String> stdout; |
| 251 List<String> stderr; | 251 List<String> stderr; |
| 252 List<Function> handlers; | 252 List<Function> handlers; |
| 253 bool allowRetries; | 253 bool allowRetries = false; |
| 254 | 254 |
| 255 RunningProcess(TestCase this.testCase, this.allowRetries); | 255 RunningProcess(TestCase this.testCase, [this.allowRetries]); |
| 256 | 256 |
| 257 void exitHandler(int exitCode) { | 257 void exitHandler(int exitCode) { |
| 258 new TestOutput(testCase, exitCode, timedOut, stdout, | 258 new TestOutput(testCase, exitCode, timedOut, stdout, |
| 259 stderr, new Date.now().difference(startTime)); | 259 stderr, new Date.now().difference(startTime)); |
| 260 process.close(); | 260 process.close(); |
| 261 timeoutTimer.cancel(); | 261 timeoutTimer.cancel(); |
| 262 if (testCase.output.unexpectedOutput && testCase.configuration['verbose']) { | 262 if (testCase.output.unexpectedOutput && testCase.configuration['verbose']) { |
| 263 print(testCase.displayName); | 263 print(testCase.displayName); |
| 264 for (var line in testCase.output.stderr) print(line); | 264 for (var line in testCase.output.stderr) print(line); |
| 265 for (var line in testCase.output.stdout) print(line); | 265 for (var line in testCase.output.stdout) print(line); |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 // the developer doesn't waste his or her time trying to fix a bunch of | 716 // the developer doesn't waste his or her time trying to fix a bunch of |
| 717 // tests that appear to be broken but were actually just flakes that | 717 // tests that appear to be broken but were actually just flakes that |
| 718 // didn't get retried because there had already been one failure. | 718 // didn't get retried because there had already been one failure. |
| 719 new RunningProcess(test, | 719 new RunningProcess(test, |
| 720 _MAX_FAILED_NO_RETRY > _progress.numFailedTests).start(); | 720 _MAX_FAILED_NO_RETRY > _progress.numFailedTests).start(); |
| 721 } | 721 } |
| 722 _numProcesses++; | 722 _numProcesses++; |
| 723 } | 723 } |
| 724 } | 724 } |
| 725 } | 725 } |
| OLD | NEW |