Commit 4bb55fd3 authored by ricow@chromium.org's avatar ricow@chromium.org

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.
Review URL: http://codereview.chromium.org/6688068

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7285 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8066271f
......@@ -84,7 +84,7 @@ class BenchmarkTestConfiguration(test.TestConfiguration):
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)
......
......@@ -65,12 +65,6 @@ test-log/ProfLazyMode: SKIP
test-debug/DebuggerAgentProtocolOverflowHeader: SKIP
test-sockets/Socket: SKIP
# BUG(1075): Some deserialization tests fail om ARM
test-serialize/Deserialize: SKIP
test-serialize/DeserializeFromSecondSerializationAndRunScript2: SKIP
test-serialize/DeserializeAndRunScript2: SKIP
test-serialize/DeserializeFromSecondSerialization: SKIP
##############################################################################
[ $arch == arm && $crankshaft ]
......
......@@ -34,11 +34,12 @@ import utils
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 @@ class CcTestCase(test.TestCase):
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 @@ class CcTestConfiguration(test.TestConfiguration):
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 @@ class CcTestConfiguration(test.TestConfiguration):
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
......
......@@ -73,7 +73,7 @@ class ES5ConformTestConfiguration(test.TestConfiguration):
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 = []
......
......@@ -103,7 +103,7 @@ class MessageTestConfiguration(test.TestConfiguration):
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'))]
......
......@@ -120,7 +120,7 @@ class MjsunitTestConfiguration(test.TestConfiguration):
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'))]
......
......@@ -92,7 +92,7 @@ class MozillaTestConfiguration(test.TestConfiguration):
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)
......
......@@ -81,7 +81,7 @@ class SputnikTestConfiguration(test.TestConfiguration):
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')
......
......@@ -614,7 +614,7 @@ class TestRepository(TestSuite):
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 @@ class LiteralTestSuite(TestSuite):
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 @@ def Main():
'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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment