| 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 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1601 CommandQueue(this.graph, this.enqueuer, this.executor, | 1601 CommandQueue(this.graph, this.enqueuer, this.executor, |
| 1602 this._maxProcesses, this._maxBrowserProcesses, this._verbose) { | 1602 this._maxProcesses, this._maxBrowserProcesses, this._verbose) { |
| 1603 var eventCondition = graph.events.where; | 1603 var eventCondition = graph.events.where; |
| 1604 eventCondition((event) => event is dgraph.StateChangedEvent) | 1604 eventCondition((event) => event is dgraph.StateChangedEvent) |
| 1605 .listen((event) { | 1605 .listen((event) { |
| 1606 if (event.to == dgraph.NodeState.Enqueuing) { | 1606 if (event.to == dgraph.NodeState.Enqueuing) { |
| 1607 assert(event.from == dgraph.NodeState.Initialized || | 1607 assert(event.from == dgraph.NodeState.Initialized || |
| 1608 event.from == dgraph.NodeState.Waiting); | 1608 event.from == dgraph.NodeState.Waiting); |
| 1609 graph.changeState(event.node, dgraph.NodeState.Processing); | 1609 graph.changeState(event.node, dgraph.NodeState.Processing); |
| 1610 var command = event.node.userData; | 1610 var command = event.node.userData; |
| 1611 _runQueue.add(command); | 1611 if (event.node.dependencies.length > 0) { |
| 1612 _runQueue.addFirst(command); |
| 1613 } else { |
| 1614 _runQueue.add(command); |
| 1615 } |
| 1612 Timer.run(() => _tryRunNextCommand()); | 1616 Timer.run(() => _tryRunNextCommand()); |
| 1613 } | 1617 } |
| 1614 }); | 1618 }); |
| 1615 eventCondition((event) => event is dgraph.GraphSealedEvent).listen((_) { | 1619 eventCondition((event) => event is dgraph.GraphSealedEvent).listen((_) { |
| 1616 _checkDone(); | 1620 _checkDone(); |
| 1617 }); | 1621 }); |
| 1618 } | 1622 } |
| 1619 | 1623 |
| 1620 Stream<CommandOutput> get completedCommands => _commandOutputStream.stream; | 1624 Stream<CommandOutput> get completedCommands => _commandOutputStream.stream; |
| 1621 | 1625 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2063 } | 2067 } |
| 2064 } | 2068 } |
| 2065 | 2069 |
| 2066 void eventAllTestsDone() { | 2070 void eventAllTestsDone() { |
| 2067 for (var listener in _eventListener) { | 2071 for (var listener in _eventListener) { |
| 2068 listener.allDone(); | 2072 listener.allDone(); |
| 2069 } | 2073 } |
| 2070 _allDone(); | 2074 _allDone(); |
| 2071 } | 2075 } |
| 2072 } | 2076 } |
| OLD | NEW |