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

Unified Diff: tests/corelib/test_config.dart

Issue 8536013: tools/test.dart: Handle VMOptions lines in test files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase to TOT 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 | tests/standalone/test_config.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/test_config.dart
diff --git a/tests/corelib/test_config.dart b/tests/corelib/test_config.dart
index 7128256c3ddb8a003bb22c3863362470daac9163..019ded9e3ebc2f60c3da5b14872f70993a6c8fff 100644
--- a/tests/corelib/test_config.dart
+++ b/tests/corelib/test_config.dart
@@ -63,12 +63,42 @@ class CorelibTestSuite {
}
args.add(filename);
- doTest(new TestCase(testName,
- shellPath,
- args,
- configuration["timeout"],
- completeHandler,
- expectations));
+ List<List> optionsList = testOptions(filename);
+ if (optionsList.isEmpty()) {
+ doTest(new TestCase(testName,
+ shellPath,
+ args,
+ configuration["timeout"],
+ completeHandler,
+ expectations));
+ } else {
+ for (var options in optionsList) {
+ options.addAll(args);
+ doTest(new TestCase(testName,
+ shellPath,
+ options,
+ configuration["timeout"],
+ completeHandler,
+ expectations));
+ }
+ }
+ }
+
+ List<List> testOptions(String filename) {
+ RegExp testOptionsRegExp = const RegExp(@"// VMOptions=(.*)");
+ File file = new File(filename);
+ FileInputStream fileStream = file.openInputStream();
+ StringInputStream lines = new StringInputStream(fileStream);
+
+ List<List> result = new List<List>();
+ String line;
+ while ((line = lines.readLine()) != null) {
+ Match match = testOptionsRegExp.firstMatch(line);
+ if (match != null) {
+ result.add(match[1].split(' ').filter((e) => e != ''));
+ }
+ }
+ return result;
}
void completeHandler(TestCase testCase) {
« no previous file with comments | « no previous file | tests/standalone/test_config.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698