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

Unified Diff: tools/test.dart

Issue 8565001: Fix activity tracking in test scripts. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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/test.dart
diff --git a/tools/test.dart b/tools/test.dart
index 1219d531dd2f68123c162ba7b186934ed0013737..0954647bb54282ad377c3c8ae0c15f5f66cc71de 100755
--- a/tools/test.dart
+++ b/tools/test.dart
@@ -11,22 +11,23 @@
#import("../tests/standalone/test_config.dart");
#import("../tests/corelib/test_config.dart");
-
// TODO(ager): This activity tracking is temporary until stdout is
// closed implicitly when nothing more can happen.
int pendingActivities = 0;
-void onExit() {
- stdout.write('\n'.charCodes());
- stdout.close();
-}
-
void activityStarted() {
- pendingActivities++;
+ ++pendingActivities;
}
void activityCompleted() {
- if (--pendingActivities == 0) onExit();
+ --pendingActivities;
+}
+
+void exitIfLastActivity() {
+ if (pendingActivities == 1) {
+ stdout.write('\n'.charCodes());
+ stdout.close();
+ }
}
main() {
@@ -34,7 +35,7 @@ main() {
var configurations = optionsParser.parse(new Options().arguments);
if (configurations == null) return;
activityStarted();
- var queue = new ProcessQueue(configurations[0], activityCompleted);
+ var queue = new ProcessQueue(configurations[0], exitIfLastActivity);
for (var conf in configurations) {
activityStarted();
new StandaloneTestSuite(conf).forEachTest(queue.runTest, activityCompleted);
« 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