| 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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 _numProcesses++; | 1014 _numProcesses++; |
| 1015 if (isBrowserCommand) _numBrowserProcesses++; | 1015 if (isBrowserCommand) _numBrowserProcesses++; |
| 1016 | 1016 |
| 1017 var node = enqueuer.command2node[command]; | 1017 var node = enqueuer.command2node[command]; |
| 1018 Iterable<TestCase> testCases = enqueuer.command2testCases[command]; | 1018 Iterable<TestCase> testCases = enqueuer.command2testCases[command]; |
| 1019 // If a command is part of many TestCases we set the timeout to be | 1019 // If a command is part of many TestCases we set the timeout to be |
| 1020 // the maximum over all [TestCase.timeout]s. At some point, we might | 1020 // the maximum over all [TestCase.timeout]s. At some point, we might |
| 1021 // eliminate [TestCase.timeout] completely and move it to [Command]. | 1021 // eliminate [TestCase.timeout] completely and move it to [Command]. |
| 1022 int timeout = | 1022 int timeout = testCases |
| 1023 testCases.map((TestCase test) => test.timeout).fold(0, math.max); | 1023 .map((TestCase test) => test.timeout) |
| 1024 .fold(0, (int a, b) => math.max(a, b)); |
| 1024 | 1025 |
| 1025 if (_verbose) { | 1026 if (_verbose) { |
| 1026 print('Running "${command.displayName}" command: $command'); | 1027 print('Running "${command.displayName}" command: $command'); |
| 1027 } | 1028 } |
| 1028 | 1029 |
| 1029 executor.runCommand(node, command, timeout).then((CommandOutput output) { | 1030 executor.runCommand(node, command, timeout).then((CommandOutput output) { |
| 1030 assert(command == output.command); | 1031 assert(command == output.command); |
| 1031 | 1032 |
| 1032 _commandOutputStream.add(output); | 1033 _commandOutputStream.add(output); |
| 1033 if (output.canRunDependendCommands) { | 1034 if (output.canRunDependendCommands) { |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1647 } | 1648 } |
| 1648 } | 1649 } |
| 1649 | 1650 |
| 1650 void eventAllTestsDone() { | 1651 void eventAllTestsDone() { |
| 1651 for (var listener in _eventListener) { | 1652 for (var listener in _eventListener) { |
| 1652 listener.allDone(); | 1653 listener.allDone(); |
| 1653 } | 1654 } |
| 1654 _allDone(); | 1655 _allDone(); |
| 1655 } | 1656 } |
| 1656 } | 1657 } |
| OLD | NEW |