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

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

Issue 8715006: tools/test.dart: Add multitest support to Dart implementation of test runner. (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
« tools/testing/dart/multitest.dart ('K') | « 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 5016e41c4e817ecb3b8067602dc7bf6f47470ac7..9a9b1b57f0d8a25b69a67c93a623b65505cbceba 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -6,6 +6,8 @@
#import("status_file_parser.dart");
#import("test_runner.dart");
+#import("multitest.dart");
+
interface TestSuite {
void forEachTest(Function onTest, [Function onDone]);
@@ -186,19 +188,30 @@ class StandardTestSuite implements TestSuite {
if (expectations.contains(SKIP)) return;
- var optionsFromFile = optionsFromFile(filename);
- var isNegative = optionsFromFile['isNegative'];
- var argumentLists = argumentListsFromFile(filename, optionsFromFile);
var timeout = configuration['timeout'];
+ var optionsFromFile = optionsFromFile(filename);
- for (var args in argumentLists) {
- doTest(new TestCase(testName,
- shellPath,
- args,
- timeout,
- completeHandler,
- expectations,
- isNegative));
+ Function doTestBound(filename, isNegative, isNegativeIfChecked) {
Mads Ager (google) 2011/11/29 08:12:04 What does the 'Bound' part of this name mean? sche
+ isNegative = isNegative ||
+ (configuration['checked'] && isNegativeIfChecked);
+ var argumentLists = argumentListsFromFile(filename, optionsFromFile);
+ for (var args in argumentLists) {
+ doTest(new TestCase(testName,
+ shellPath,
+ args,
+ timeout,
+ completeHandler,
+ expectations,
+ isNegative));
+ }
+ }
+
+
+ if (optionsFromFile['isMultitest']) {
+ DoMultitest(filename, doTestBound);
+ } else {
+ var isNegative = optionsFromFile['isNegative'];
+ doTestBound(filename, isNegative, false);
}
}
@@ -210,17 +223,24 @@ class StandardTestSuite implements TestSuite {
Map optionsFromFile) {
List args = TestUtils.standardOptions(configuration);
+ bool isMultitest = optionsFromFile["isMultitest"];
List<String> dartOptions = optionsFromFile["dartOptions"];
+ List<List<String>> vmOptionsList = optionsFromFile["vmOptions"];
+ Expect.isTrue(!isMultitest || dartOptions == null);
args.addAll(dartOptions == null ? [filename] : dartOptions);
var result = new List<List<String>>();
- List<List<String>> vmOptionsList = optionsFromFile["vmOptions"];
if (vmOptionsList.isEmpty()) {
Bill Hesse 2011/11/28 15:29:47 This if statement can be removed now.
result.add(args);
} else {
for (var vmOptions in vmOptionsList) {
+ if (isMultitest) {
+ // Make copy of vmOptions, since we will modify it at each iteration.
+ vmOptions = new List<String>.from(vmOptions);
+ }
vmOptions.addAll(args);
result.add(vmOptions);
+ print("vmOptions added, filename = $filename");
Mads Ager (google) 2011/11/29 08:12:04 Remove debug printing.
}
}
@@ -254,6 +274,7 @@ class StandardTestSuite implements TestSuite {
for (var match in matches) {
result.add(match[1].split(' ').filter((e) => e != ''));
}
+ if (result.isEmpty()) result.add([]);
matches = dartOptionsRegExp.allMatches(contents);
for (var match in matches) {
@@ -272,9 +293,12 @@ class StandardTestSuite implements TestSuite {
isNegative = true;
}
+ bool isMultitest = contents.contains("///");
+
return { "vmOptions": result,
"dartOptions": dartOptions,
- "isNegative" : isNegative };
+ "isNegative": isNegative,
+ "isMultitest": isMultitest};
}
}
« tools/testing/dart/multitest.dart ('K') | « tools/testing/dart/multitest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698