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

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

Issue 8773004: tools/test.dart: Add synchronization, so the process queue knows when all multitests are done. (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 | « tools/testing/dart/multitest.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 2349a24f0cbf28a673bae5647ad771de15f82de2..e5e48a0061e75b01263d4006a179643b0dcdc13c 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -128,6 +128,8 @@ class StandardTestSuite implements TestSuite {
List<String> statusFilePaths;
Function doTest;
Function doDone;
+ int activeMultitests = 0;
+ bool listingDone = false;
String shellPath;
TestExpectations testExpectations;
@@ -146,7 +148,7 @@ class StandardTestSuite implements TestSuite {
void forEachTest(Function onTest, [Function onDone = null]) {
doTest = onTest;
- doDone = (ignore) => (onDone != null) ? onDone() : null;
+ doDone = (onDone != null) ? onDone : (() => null);
// Read test expectations from status files.
testExpectations =
@@ -167,7 +169,7 @@ class StandardTestSuite implements TestSuite {
throw s;
};
dir.fileHandler = processFile;
- dir.doneHandler = doDone;
+ dir.doneHandler = directoryListingDone;
dir.list(recursive: listRecursively());
}
@@ -222,15 +224,31 @@ class StandardTestSuite implements TestSuite {
if (optionsFromFile['isMultitest']) {
+ ++activeMultitests;
DoMultitest(filename,
TestUtils.buildDir(configuration),
directoryPath,
- createTestCase);
+ createTestCase,
+ multitestDone);
} else {
createTestCase(filename, optionsFromFile['isNegative']);
}
}
+ void multitestDone() {
+ --activeMultitests;
+ if (activeMultitests == 0 && listingDone) {
+ doDone();
+ }
+ }
+
+ void directoryListingDone(ignore) {
+ listingDone = true;
+ if (activeMultitests == 0 && listingDone) {
Mads Ager (google) 2011/12/01 11:50:47 You don't need to check for listingDone here.
+ doDone();
+ }
+ }
+
void completeHandler(TestCase testCase) {
}
« no previous file with comments | « tools/testing/dart/multitest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698