Reviewers: Erik Corry,
Description:
Change cctests to use variant flags as part of the name for the serilization
file.
Because we run all tests three times with different variant flags (to
test crankshaft) we might end up in a situation where we try to write
to the same serilization file from two different threads
simultaneously. The patch concats the variant flags at the end of the
serialization file name.
Please review this at http://codereview.chromium.org/6688068/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M test/benchmarks/testcfg.py
M test/cctest/testcfg.py
M test/es5conform/testcfg.py
M test/message/testcfg.py
M test/mjsunit/testcfg.py
M test/mozilla/testcfg.py
M test/sputnik/testcfg.py
M tools/test.py
Index: test/benchmarks/testcfg.py
===================================================================
--- test/benchmarks/testcfg.py (revision 7276)
+++ test/benchmarks/testcfg.py (working copy)
@@ -84,7 +84,7 @@
def __init__(self, context, root):
super(BenchmarkTestConfiguration, self).__init__(context, root)
- def ListTests(self, current_path, path, mode):
+ def ListTests(self, current_path, path, mode, variant_flags):
path = self.context.workspace
path = join(path, 'benchmarks')
test = BenchmarkTestCase(path, self.context, mode)
Index: test/cctest/testcfg.py
===================================================================
--- test/cctest/testcfg.py (revision 7276)
+++ test/cctest/testcfg.py (working copy)
@@ -34,11 +34,12 @@
class CcTestCase(test.TestCase):
- def __init__(self, path, executable, mode, raw_name, dependency,
context):
+ def __init__(self, path, executable, mode, raw_name, dependency,
context, variant_flags):
super(CcTestCase, self).__init__(context, path, mode)
self.executable = executable
self.raw_name = raw_name
self.dependency = dependency
+ self.variant_flags = variant_flags
def GetLabel(self):
return "%s %s %s" % (self.mode, self.path[-2], self.path[-1])
@@ -50,6 +51,7 @@
serialization_file = join('obj', 'test', self.mode, 'serdes')
serialization_file += '_' + self.GetName()
serialization_file = join(self.context.buildspace, serialization_file)
+ serialization_file += ''.join(self.variant_flags).replace('-', '_')
serialization_option = '--testing_serialization_file=' +
serialization_file
result = [ self.executable, name, serialization_option ]
result += self.context.GetVmFlags(self, self.mode)
@@ -75,7 +77,7 @@
def GetBuildRequirements(self):
return ['cctests']
- def ListTests(self, current_path, path, mode):
+ def ListTests(self, current_path, path, mode, variant_flags):
executable = join('obj', 'test', mode, 'cctest')
if utils.IsWindows():
executable += '.exe'
@@ -93,7 +95,7 @@
if dependency != '':
dependency = relative_path[0] + '/' + dependency
if self.Contains(path, full_path):
- result.append(CcTestCase(full_path, executable, mode, raw_test,
dependency, self.context))
+ result.append(CcTestCase(full_path, executable, mode, raw_test,
dependency, self.context, variant_flags))
result.sort()
return result
Index: test/es5conform/testcfg.py
===================================================================
--- test/es5conform/testcfg.py (revision 7276)
+++ test/es5conform/testcfg.py (working copy)
@@ -73,7 +73,7 @@
def __init__(self, context, root):
super(ES5ConformTestConfiguration, self).__init__(context, root)
- def ListTests(self, current_path, path, mode):
+ def ListTests(self, current_path, path, mode, variant_flags):
tests = []
current_root = join(self.root, 'data', 'TestCases')
harness = []
Index: test/message/testcfg.py
===================================================================
--- test/message/testcfg.py (revision 7276)
+++ test/message/testcfg.py (working copy)
@@ -103,7 +103,7 @@
else:
return []
- def ListTests(self, current_path, path, mode):
+ def ListTests(self, current_path, path, mode, variant_flags):
mjsunit = [current_path + [t] for t in self.Ls(self.root)]
regress = [current_path + ['regress', t] for t in
self.Ls(join(self.root, 'regress'))]
bugs = [current_path + ['bugs', t] for t in
self.Ls(join(self.root, 'bugs'))]
Index: test/mjsunit/testcfg.py
===================================================================
--- test/mjsunit/testcfg.py (revision 7276)
+++ test/mjsunit/testcfg.py (working copy)
@@ -120,7 +120,7 @@
return name.endswith('.js') and name != 'mjsunit.js'
return [f[:-3] for f in os.listdir(path) if SelectTest(f)]
- def ListTests(self, current_path, path, mode):
+ def ListTests(self, current_path, path, mode, variant_flags):
mjsunit = [current_path + [t] for t in self.Ls(self.root)]
regress = [current_path + ['regress', t] for t in
self.Ls(join(self.root, 'regress'))]
bugs = [current_path + ['bugs', t] for t in
self.Ls(join(self.root, 'bugs'))]
Index: test/mozilla/testcfg.py
===================================================================
--- test/mozilla/testcfg.py (revision 7276)
+++ test/mozilla/testcfg.py (working copy)
@@ -92,7 +92,7 @@
def __init__(self, context, root):
super(MozillaTestConfiguration, self).__init__(context, root)
- def ListTests(self, current_path, path, mode):
+ def ListTests(self, current_path, path, mode, variant_flags):
tests = []
for test_dir in TEST_DIRS:
current_root = join(self.root, 'data', test_dir)
Index: test/sputnik/testcfg.py
===================================================================
--- test/sputnik/testcfg.py (revision 7276)
+++ test/sputnik/testcfg.py (working copy)
@@ -81,7 +81,7 @@
def __init__(self, context, root):
super(SputnikTestConfiguration, self).__init__(context, root)
- def ListTests(self, current_path, path, mode):
+ def ListTests(self, current_path, path, mode, variant_flags):
# Import the sputnik test runner script as a module
testroot = join(self.root, 'sputniktests')
modroot = join(testroot, 'tools')
Index: tools/test.py
===================================================================
--- tools/test.py (revision 7276)
+++ tools/test.py (working copy)
@@ -614,7 +614,7 @@
def AddTestsToList(self, result, current_path, path, context, mode):
for v in VARIANT_FLAGS:
- tests = self.GetConfiguration(context).ListTests(current_path, path,
mode)
+ tests = self.GetConfiguration(context).ListTests(current_path, path,
mode, v)
for t in tests: t.variant_flags = v
result += tests
@@ -637,7 +637,7 @@
result += test.GetBuildRequirements(rest, context)
return result
- def ListTests(self, current_path, path, context, mode):
+ def ListTests(self, current_path, path, context, mode, variant_flags):
(name, rest) = CarCdr(path)
result = [ ]
for test in self.tests:
@@ -1419,7 +1419,7 @@
'simulator': options.simulator,
'crankshaft': options.crankshaft
}
- test_list = root.ListTests([], path, context, mode)
+ test_list = root.ListTests([], path, context, mode, [])
unclassified_tests += test_list
(cases, unused_rules, all_outcomes) =
config.ClassifyTests(test_list, env)
if globally_unused_rules is None:
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev