Chromium Code Reviews| Index: tests/corelib/test_config.dart |
| diff --git a/tests/corelib/test_config.dart b/tests/corelib/test_config.dart |
| index 019ded9e3ebc2f60c3da5b14872f70993a6c8fff..4b8ff409a8e26e3623eac0f52e1da28b1c7b6345 100644 |
| --- a/tests/corelib/test_config.dart |
| +++ b/tests/corelib/test_config.dart |
| @@ -61,9 +61,12 @@ class CorelibTestSuite { |
| if (configuration["component"] == "leg") { |
| args.add("--enable_leg"); |
| } |
| - args.add(filename); |
| - List<List> optionsList = testOptions(filename); |
| + var optionsFromFile = testOptions(filename); |
| + List<List<String>> optionsList = optionsFromFile["vmOptions"]; |
| + List<String> dartOptions = optionsFromFile["dartOptions"]; |
| + args.addAll(dartOptions == null ? [filename] : dartOptions); |
| + |
| if (optionsList.isEmpty()) { |
| doTest(new TestCase(testName, |
| shellPath, |
| @@ -84,21 +87,31 @@ class CorelibTestSuite { |
| } |
| } |
| - 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'); |
|
Bill Hesse
2011/11/14 11:58:12
add "... in test $filename".
Perhaps this should
Mads Ager (google)
2011/11/14 12:03:56
I think throwing is fine. The test will not behave
|
| + } |
| + dartOptions = match[1].split(' ').filter((e) => e != ''); |
| + } |
| } |
| - return result; |
| + return {"vmOptions": result, "dartOptions": dartOptions}; |
| } |
| void completeHandler(TestCase testCase) { |