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