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

Unified Diff: tests/standalone/test_config.dart

Issue 8565006: tools/test.dart: Enable // DartOptions= lines in Dart 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
« tests/corelib/test_config.dart ('K') | « tests/corelib/test_config.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/test_config.dart
diff --git a/tests/standalone/test_config.dart b/tests/standalone/test_config.dart
index c09e01aed7a8d513b433abc13ad88b18c756c6f2..413e4f8f06d897981dea4adc1523368a43b6f3de 100644
--- a/tests/standalone/test_config.dart
+++ b/tests/standalone/test_config.dart
@@ -61,10 +61,12 @@ class StandaloneTestSuite {
if (configuration["component"] == "leg") {
args.add("--enable_leg");
}
- args.add(filename);
+ var optionsFromFile = testOptions(filename);
+ List<List<String>> optionsList = optionsFromFile["vmOptions"];
+ List<String> dartOptions = optionsFromFile["dartOptions"];
+ args.addAll(dartOptions == null ? [filename] : dartOptions);
- List<List> optionsList = testOptions(filename);
if (optionsList.isEmpty()) {
doTest(new TestCase(testName,
shellPath,
@@ -85,21 +87,31 @@ class StandaloneTestSuite {
}
}
- List<List> testOptions(String filename) {
+ Map testOptions(String filename) {
RegExp testOptionsRegExp = const RegExp(@"// VMOptions=(.*)");
+ RegExp dartOptionsRegExp = const RegExp(@"// DartOptions=(.*)");
File file = new File(filename);
FileInputStream fileStream = file.openInputStream();
StringInputStream lines = new StringInputStream(fileStream);
List<List> result = new List<List>();
+ List<String> dartOptions;
String line;
while ((line = lines.readLine()) != null) {
Match match = testOptionsRegExp.firstMatch(line);
if (match != null) {
result.add(match[1].split(' ').filter((e) => e != ''));
}
+
+ match = dartOptionsRegExp.firstMatch(line);
+ if (match != null) {
+ if (dartOptions != null) {
+ throw new Exception('More than one "// DartOptions=" line in test');
+ }
+ dartOptions = match[1].split(' ').filter((e) => e != '');
+ }
}
- return result;
+ return {"vmOptions": result, "dartOptions": dartOptions};
}
void completeHandler(TestCase testCase) {
« tests/corelib/test_config.dart ('K') | « tests/corelib/test_config.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698