Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Unified Diff: tools/testing/dart/test_runner.dart

Issue 22322007: test.py In case we don't have any TestCases, don't block (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_runner.dart
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 33ac5120b1e21d99dd71d6eec6a24aa22118e855..1012082a09c9db18dd90d3520551334e2136240c 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -1927,6 +1927,7 @@ class TestCaseCompleter {
final CommandQueue commandQueue;
Map<Command, CommandOutput> _outputs = new Map<Command, CommandOutput>();
+ bool _closed = false;
StreamController<TestCase> _controller = new StreamController<TestCase>();
TestCaseCompleter(this.graph, this.enqueuer, this.commandQueue) {
@@ -1946,11 +1947,24 @@ class TestCaseCompleter {
assert(COMPLETED_STATES.contains(event.to));
_completeTestCasesIfPossible(event.node.userData);
- if (graph.isSealed && enqueuer.remainingTestCases.isEmpty) {
+ if (!_closed &&
+ graph.isSealed &&
+ enqueuer.remainingTestCases.isEmpty) {
_controller.close();
+ _closed = true;
}
}
});
+
+ // Listen also for GraphSealedEvent's. If there is not a single node in the
+ // graph, we still want to finish after the graph was sealed.
+ eventCondition((event) => event is dgraph.GraphSealedEvent)
+ .listen((dgraph.GraphSealedEvent event) {
+ if (!_closed && enqueuer.remainingTestCases.isEmpty) {
+ _controller.close();
+ _closed = true;
+ }
+ });
}
Stream<TestCase> get finishedTestCases => _controller.stream;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698