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

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: Address comments, fix type error. 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 f70ee6bbf64378e9cf2c4d0231944abfa19a967c..4137c98f41ea9103da6c5138f69a066941c37223 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;
@@ -148,7 +150,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 =
@@ -169,7 +171,7 @@ class StandardTestSuite implements TestSuite {
throw s;
};
dir.fileHandler = processFile;
- dir.doneHandler = doDone;
+ dir.doneHandler = directoryListingDone;
dir.list(recursive: listRecursively());
}
@@ -224,15 +226,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) {
+ 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