| 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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 command.outputIsUpToDate.then((bool isUpToDate) { | 955 command.outputIsUpToDate.then((bool isUpToDate) { |
| 956 if (isUpToDate) { | 956 if (isUpToDate) { |
| 957 compilationSkipped = true; | 957 compilationSkipped = true; |
| 958 _commandComplete(0); | 958 _commandComplete(0); |
| 959 } else { | 959 } else { |
| 960 var processOptions = _createProcessOptions(); | 960 var processOptions = _createProcessOptions(); |
| 961 Future processFuture = io.Process.start(command.executable, | 961 Future processFuture = io.Process.start(command.executable, |
| 962 command.arguments, | 962 command.arguments, |
| 963 processOptions); | 963 processOptions); |
| 964 processFuture.then((io.Process process) { | 964 processFuture.then((io.Process process) { |
| 965 // Close stdin so that tests that try to block on input will fail. |
| 966 process.stdin.close(); |
| 965 void timeoutHandler() { | 967 void timeoutHandler() { |
| 966 timedOut = true; | 968 timedOut = true; |
| 967 if (process != null) { | 969 if (process != null) { |
| 968 process.kill(); | 970 process.kill(); |
| 969 } | 971 } |
| 970 } | 972 } |
| 971 process.exitCode.then(_commandComplete); | 973 process.exitCode.then(_commandComplete); |
| 972 _drainStream(process.stdout, stdout); | 974 _drainStream(process.stdout, stdout); |
| 973 _drainStream(process.stderr, stderr); | 975 _drainStream(process.stderr, stderr); |
| 974 timeoutTimer = new Timer(new Duration(seconds: testCase.timeout), | 976 timeoutTimer = new Timer(new Duration(seconds: testCase.timeout), |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 } | 1718 } |
| 1717 } | 1719 } |
| 1718 | 1720 |
| 1719 void eventAllTestsDone() { | 1721 void eventAllTestsDone() { |
| 1720 for (var listener in _eventListener) { | 1722 for (var listener in _eventListener) { |
| 1721 listener.allDone(); | 1723 listener.allDone(); |
| 1722 } | 1724 } |
| 1723 } | 1725 } |
| 1724 } | 1726 } |
| 1725 | 1727 |
| OLD | NEW |