Let test configuration disable variant flags. Used for preparser tests.
authorlrn@chromium.org <lrn@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 9 May 2011 09:02:27 +0000 (09:02 +0000)
committerlrn@chromium.org <lrn@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 9 May 2011 09:02:27 +0000 (09:02 +0000)
Fixes problem with nosse[234] tests (or anything else that would pass an
unexpected extra parameter on the preparser test command line).

Review URL: http://codereview.chromium.org/6965008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7814 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/preparser/testcfg.py
tools/test.py

index 81cafb9979b86f8e4ed9fb657ed25a12d4f1f123..afe3d7d1353f4c709ebee10bab149a11c64666b2 100644 (file)
@@ -110,6 +110,9 @@ class PreparserTestConfiguration(test.TestConfiguration):
     if exists(status_file):
       test.ReadConfigurationInto(status_file, sections, defs)
 
+  def VariantFlags(self):
+    return [[]];
+
 
 def GetConfiguration(context, root):
   return PreparserTestConfiguration(context, root)
index c1840bb428803f36ee3727da4b325d0bb487c5bc..cb2428cab852892c1eaa0e89106e1032e76fc723 100755 (executable)
@@ -392,7 +392,7 @@ class TestCase(object):
       result = self.RunCommand(self.GetCommand())
     except:
       self.terminate = True
-      raise BreakNowException("Used pressed CTRL+C or IO went wrong")
+      raise BreakNowException("User pressed CTRL+C or IO went wrong")
     finally:
       self.AfterRun(result)
     return result
@@ -566,6 +566,13 @@ def CarCdr(path):
     return (path[0], path[1:])
 
 
+# Use this to run several variants of the tests, e.g.:
+# VARIANT_FLAGS = [[], ['--always_compact', '--noflush_code']]
+VARIANT_FLAGS = [[],
+                 ['--stress-opt', '--always-opt'],
+                 ['--nocrankshaft']]
+
+
 class TestConfiguration(object):
 
   def __init__(self, context, root):
@@ -583,6 +590,11 @@ class TestConfiguration(object):
   def GetTestStatus(self, sections, defs):
     pass
 
+  def VariantFlags(self):
+    return VARIANT_FLAGS
+
+
+
 
 class TestSuite(object):
 
@@ -593,13 +605,6 @@ class TestSuite(object):
     return self.name
 
 
-# Use this to run several variants of the tests, e.g.:
-# VARIANT_FLAGS = [[], ['--always_compact', '--noflush_code']]
-VARIANT_FLAGS = [[],
-                 ['--stress-opt', '--always-opt'],
-                 ['--nocrankshaft']]
-
-
 class TestRepository(TestSuite):
 
   def __init__(self, path):
@@ -627,12 +632,11 @@ class TestRepository(TestSuite):
     return self.GetConfiguration(context).GetBuildRequirements()
 
   def AddTestsToList(self, result, current_path, path, context, mode):
-    for v in VARIANT_FLAGS:
+    for v in self.GetConfiguration(context).VariantFlags():
       tests = self.GetConfiguration(context).ListTests(current_path, path, mode, v)
       for t in tests: t.variant_flags = v
       result += tests
 
-
   def GetTestStatus(self, context, sections, defs):
     self.GetConfiguration(context).GetTestStatus(sections, defs)