Chromium Code Reviews| Index: tools/testing/test_configuration.py |
| diff --git a/tools/testing/test_configuration.py b/tools/testing/test_configuration.py |
| index 1b5bca3b07ade573195477d1b740e0afc1f7cc3b..a1cf5477aacfc0b41e04e2d0b03533b08a084bb5 100644 |
| --- a/tools/testing/test_configuration.py |
| +++ b/tools/testing/test_configuration.py |
| @@ -20,6 +20,9 @@ from os.path import join, exists, basename |
| import utils |
| +# Patterns for matching test options in .dart files. |
| +VM_OPTIONS_PATTERN = re.compile(r"// VMOptions=(.*)") |
| + |
| class Error(Exception): |
| pass |
| @@ -70,8 +73,24 @@ class StandardTestConfiguration(test.TestConfiguration): |
| tests.append(test_case.MultiTestCase(self.context, |
| test_path + [tag], test_source, kind, mode, arch)) |
| else: |
| - tests.append(test_case.StandardTestCase(self.context, |
| - test_path, filename, mode, arch)) |
| + if arch in ['ia32', 'x64', 'simarm', 'arm']: |
| + # Look for VM specified as comments in teh source file. If |
|
Ivan Posva
2011/10/13 07:17:34
Look for VM options specified...
teh -> the
Søren Gjesse
2011/10/13 07:28:15
Done.
|
| + # several sets of VM options are specified create a separate |
| + # test for each set. |
| + source = file(filename).read() |
| + vm_options = utils.ParseTestOptionsMultiple(VM_OPTIONS_PATTERN, |
| + source, |
| + test_path) |
| + if vm_options: |
| + for options in vm_options: |
| + tests.append(test_case.StandardTestCase(self.context, |
| + test_path, filename, mode, arch, options)) |
| + else: |
| + tests.append(test_case.StandardTestCase(self.context, |
| + test_path, filename, mode, arch)) |
| + else: |
| + tests.append(test_case.StandardTestCase(self.context, |
| + test_path, filename, mode, arch)) |
| return tests |
| def ListTests(self, current_path, path, mode, arch): |
| @@ -169,7 +188,7 @@ class BrowserTestCase(test_case.StandardTestCase): |
| def IsBatchable(self): |
| return True |
| - |
| + |
| def Run(self): |
| command = self.run_arch.GetCompileCommand(self.fatal_static_type_errors) |
| if command != None: |
| @@ -249,7 +268,7 @@ class CompilationTestConfiguration(test.TestConfiguration): |
| filename.append(f) # Remove .lib or .app suffix. |
| test_path = current_path + filename |
| test_dart_file = os.path.join(root, f) |
| - if ((not self.Contains(path, test_path)) |
| + if ((not self.Contains(path, test_path)) |
| or (not self.IsTest(test_dart_file))): |
| continue |
| tests.append(test_case.CompilationTestCase(test_path, |