test_backup[s] = s.tests
analysis_flags = ["--deopt-every-n-times", "%d" % MAX_DEOPT,
"--print-deopt-stress"]
- s.tests = [ t.CopyAddingFlags(analysis_flags) for t in s.tests ]
+ s.tests = [ t.CopyAddingFlags(t.variant, analysis_flags) for t in s.tests ]
num_tests += len(s.tests)
for t in s.tests:
t.id = test_id
print "%s %s" % (t.path, distribution)
for i in distribution:
fuzzing_flags = ["--deopt-every-n-times", "%d" % i]
- s.tests.append(t.CopyAddingFlags(fuzzing_flags))
+ s.tests.append(t.CopyAddingFlags(t.variant, fuzzing_flags))
num_tests += len(s.tests)
for t in s.tests:
t.id = test_id
verbose.PrintTestSource(s.tests)
continue
variant_gen = s.CreateVariantGenerator(VARIANTS)
- variant_tests = [ t.CopyAddingFlags(flags)
+ variant_tests = [ t.CopyAddingFlags(v, flags)
for t in s.tests
for v in variant_gen.FilterVariantsByTest(t)
for flags in variant_gen.GetFlagSets(t, v) ]
else:
yield ["--random-seed=%d" % RandomSeed()]
s.tests = [
- t.CopyAddingFlags(flags)
+ t.CopyAddingFlags(t.variant, flags)
for t in variant_tests
for flags in iter_seed_flags()
]
options.junitout, options.junittestsuite))
if options.json_test_results:
progress_indicator.Register(progress.JsonTestProgressIndicator(
- options.json_test_results, arch, MODES[mode]["execution_mode"]))
+ options.json_test_results, arch, MODES[mode]["execution_mode"],
+ ctx.random_seed))
run_networked = not options.no_network
if not run_networked:
class JsonTestProgressIndicator(ProgressIndicator):
- def __init__(self, json_test_results, arch, mode):
+ def __init__(self, json_test_results, arch, mode, random_seed):
self.json_test_results = json_test_results
self.arch = arch
self.mode = mode
+ self.random_seed = random_seed
self.results = []
self.tests = []
"result": test.suite.GetOutcome(test),
"expected": list(test.outcomes or ["PASS"]),
"duration": test.duration,
+
+ # TODO(machenbach): This stores only the global random seed from the
+ # context and not possible overrides when using random-seed stress.
+ "random_seed": self.random_seed,
+ "variant": test.variant,
})
from . import output
class TestCase(object):
- def __init__(self, suite, path, flags=None, dependency=None):
+ def __init__(self, suite, path, variant='default', flags=None,
+ dependency=None):
self.suite = suite # TestSuite object
self.path = path # string, e.g. 'div-mod', 'test-api/foo'
self.flags = flags or [] # list of strings, flags specific to this test
+ self.variant = variant # name of the used testing variant
self.dependency = dependency # |path| for testcase that must be run first
self.outcomes = set([])
self.output = None
self.duration = None # assigned during execution
self.run = 1 # The nth time this test is executed.
- def CopyAddingFlags(self, flags):
- copy = TestCase(self.suite, self.path, self.flags + flags, self.dependency)
+ def CopyAddingFlags(self, variant, flags):
+ copy = TestCase(self.suite, self.path, variant, self.flags + flags,
+ self.dependency)
copy.outcomes = self.outcomes
return copy
and returns them as a JSON serializable object.
"""
assert self.id is not None
- return [self.suitename(), self.path, self.flags,
+ return [self.suitename(), self.path, self.variant, self.flags,
self.dependency, list(self.outcomes or []), self.id]
@staticmethod
def UnpackTask(task):
"""Creates a new TestCase object based on packed task data."""
# For the order of the fields, refer to PackTask() above.
- test = TestCase(str(task[0]), task[1], task[2], task[3])
- test.outcomes = set(task[4])
- test.id = task[5]
+ test = TestCase(str(task[0]), task[1], task[2], task[3], task[4])
+ test.outcomes = set(task[5])
+ test.id = task[6]
test.run = 1
return test