| 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 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1957 doStartTest(command, timeout); | 1957 doStartTest(command, timeout); |
| 1958 }); | 1958 }); |
| 1959 } else if (!sameRunnerType) { | 1959 } else if (!sameRunnerType) { |
| 1960 // Restart this runner with the right executable for this test if needed. | 1960 // Restart this runner with the right executable for this test if needed. |
| 1961 _processExitHandler = (_) { | 1961 _processExitHandler = (_) { |
| 1962 _startProcess(() { | 1962 _startProcess(() { |
| 1963 doStartTest(command, timeout); | 1963 doStartTest(command, timeout); |
| 1964 }); | 1964 }); |
| 1965 }; | 1965 }; |
| 1966 _process.kill(); | 1966 _process.kill(); |
| 1967 _stdoutSubscription.cancel(); |
| 1968 _stderrSubscription.cancel(); |
| 1967 } else { | 1969 } else { |
| 1968 doStartTest(command, timeout); | 1970 doStartTest(command, timeout); |
| 1969 } | 1971 } |
| 1970 return _completer.future; | 1972 return _completer.future; |
| 1971 } | 1973 } |
| 1972 | 1974 |
| 1973 Future terminate() { | 1975 Future terminate() { |
| 1974 if (_process == null) return new Future.value(true); | 1976 if (_process == null) return new Future.value(true); |
| 1975 Completer terminateCompleter = new Completer(); | 1977 Completer terminateCompleter = new Completer(); |
| 1976 Timer killTimer; | |
| 1977 _processExitHandler = (_) { | 1978 _processExitHandler = (_) { |
| 1978 if (killTimer != null) killTimer.cancel(); | |
| 1979 terminateCompleter.complete(true); | 1979 terminateCompleter.complete(true); |
| 1980 }; | 1980 }; |
| 1981 _process.kill(); | 1981 _process.kill(); |
| 1982 _stdoutSubscription.cancel(); |
| 1983 _stderrSubscription.cancel(); |
| 1982 | 1984 |
| 1983 return terminateCompleter.future; | 1985 return terminateCompleter.future; |
| 1984 } | 1986 } |
| 1985 | 1987 |
| 1986 void doStartTest(Command command, int timeout) { | 1988 void doStartTest(Command command, int timeout) { |
| 1987 _startTime = new DateTime.now(); | 1989 _startTime = new DateTime.now(); |
| 1988 _testStdout = new OutputLog(); | 1990 _testStdout = new OutputLog(); |
| 1989 _testStderr = new OutputLog(); | 1991 _testStderr = new OutputLog(); |
| 1990 _status = null; | 1992 _status = null; |
| 1991 _stdoutCompleter = new Completer(); | 1993 _stdoutCompleter = new Completer(); |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2940 } | 2942 } |
| 2941 } | 2943 } |
| 2942 | 2944 |
| 2943 void eventAllTestsDone() { | 2945 void eventAllTestsDone() { |
| 2944 for (var listener in _eventListener) { | 2946 for (var listener in _eventListener) { |
| 2945 listener.allDone(); | 2947 listener.allDone(); |
| 2946 } | 2948 } |
| 2947 _allDone(); | 2949 _allDone(); |
| 2948 } | 2950 } |
| 2949 } | 2951 } |
| OLD | NEW |