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

Unified Diff: tools/testing/test_configuration.py

Issue 8226016: Add the ability to run tests with several sets of VM flags (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments from ngeoffray@ Created 9 years, 2 months 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 | « tools/testing/test_case.py ('k') | tools/utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/test_configuration.py
diff --git a/tools/testing/test_configuration.py b/tools/testing/test_configuration.py
index 1b5bca3b07ade573195477d1b740e0afc1f7cc3b..75f3b54b094b2b5798ec30c5cd80b11fd789a8f1 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,20 @@ 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))
+ # Look for VM specified as comments in the source file. If
+ # several sets of VM options are specified create a separate
+ # test for each set.
+ source = file(filename).read()
+ vm_options_list = utils.ParseTestOptionsMultiple(VM_OPTIONS_PATTERN,
+ source,
+ test_path)
+ if vm_options_list:
+ for options in vm_options_list:
+ 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))
return tests
def ListTests(self, current_path, path, mode, arch):
@@ -169,7 +184,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 +264,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,
« no previous file with comments | « tools/testing/test_case.py ('k') | tools/utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698