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

Unified Diff: tools/testing/dart/multitest.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 | « no previous file | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/multitest.dart
diff --git a/tools/testing/dart/multitest.dart b/tools/testing/dart/multitest.dart
index 74ddafd57054f5c9cdee956a3b98544056a8ab7a..6dc1ace7b068ee65db31e26ca996d4d298de7090 100644
--- a/tools/testing/dart/multitest.dart
+++ b/tools/testing/dart/multitest.dart
@@ -118,9 +118,10 @@ void ExtractTestsFromMultitest(String filename,
void DoMultitest(String filename,
String buildDir,
String testDir,
- Function doTest(List<String> args,
+ Function doTest(String filename,
bool isNegative,
- bool isNegativeIfChecked)) {
+ [bool isNegativeIfChecked]),
+ Function multitestDone) {
// Each new test is a single String value in the Map tests.
Map<String, String> tests = new Map<String, String>();
Map<String, String> outcomes = new Map<String, String>();
@@ -133,7 +134,8 @@ void DoMultitest(String filename,
String baseFilename = filename.substring(start, end);
Iterator currentKey = tests.getKeys().iterator();
WriteMultitestToFileAndQueueIt(tests, outcomes, currentKey,
- '$directory$pathSeparator$baseFilename', doTest);
+ '$directory$pathSeparator$baseFilename',
+ doTest, multitestDone);
}
@@ -143,8 +145,12 @@ WriteMultitestToFileAndQueueIt(Map<String, String> tests,
Map<String, String> outcomes,
Iterator currentKey,
String basePath,
- Function doTest) {
- if (!currentKey.hasNext()) return;
+ Function doTest,
+ Function done) {
+ if (!currentKey.hasNext()) {
+ done();
+ return;
+ }
final String key = currentKey.next();
final String filename = '${basePath}_$key.dart';
final File file = new File(filename);
@@ -171,7 +177,7 @@ WriteMultitestToFileAndQueueIt(Map<String, String> tests,
// They should be registered in a persistent list, so they can
// be deleted later even if the test script is interrupted.
WriteMultitestToFileAndQueueIt(tests, outcomes, currentKey,
- basePath, doTest);
+ basePath, doTest, done);
};
file.create();
}
« no previous file with comments | « no previous file | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698