summaryrefslogtreecommitdiff
path: root/deps/v8/tools/testrunner
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2016-05-27 16:37:42 +0200
committerMichaël Zasso <targos@protonmail.com>2016-06-29 09:04:28 +0200
commit2cc29517966de7257a2f1b34c58c77225a21e05d (patch)
tree210bd177df2f06eec16e1e22edafdbcbffe66f8a /deps/v8/tools/testrunner
parentbbf3838c70aaec1dd296fa75ae334fd1c7866df3 (diff)
downloadnode-new-2cc29517966de7257a2f1b34c58c77225a21e05d.tar.gz
deps: update V8 to 5.1.281.69
Pick up the latest branch-head for V8 5.1. This branch brings in improved language support and performance improvements. For full details: http://v8project.blogspot.com/2016/04/v8-release-51.html * Picks up the latest branch head for 5.1 [1] * Edit v8 gitignore to allow trace_event copy * Update V8 DEP trace_event as per deps/v8/DEPS [2] [1] https://chromium.googlesource.com/v8/v8.git/+/dc81244 [2] https://chromium.googlesource.com/chromium/src/base/trace_event/common/+/c8c8665 PR-URL: https://github.com/nodejs/node/pull/7016 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/tools/testrunner')
-rw-r--r--deps/v8/tools/testrunner/local/commands.py16
-rw-r--r--deps/v8/tools/testrunner/local/execution.py42
-rw-r--r--deps/v8/tools/testrunner/local/statusfile.py9
-rw-r--r--deps/v8/tools/testrunner/local/testsuite.py26
-rw-r--r--deps/v8/tools/testrunner/local/utils.py2
-rw-r--r--deps/v8/tools/testrunner/objects/context.py7
-rw-r--r--deps/v8/tools/testrunner/objects/output.py7
-rw-r--r--deps/v8/tools/testrunner/objects/testcase.py21
-rw-r--r--deps/v8/tools/testrunner/testrunner.isolate12
9 files changed, 76 insertions, 66 deletions
diff --git a/deps/v8/tools/testrunner/local/commands.py b/deps/v8/tools/testrunner/local/commands.py
index a4df32c52a..e725d112f9 100644
--- a/deps/v8/tools/testrunner/local/commands.py
+++ b/deps/v8/tools/testrunner/local/commands.py
@@ -107,14 +107,16 @@ def RunProcess(verbose, timeout, args, **rest):
timer.start()
stdout, stderr = process.communicate()
timer.cancel()
- return process.returncode, timeout_result[0], stdout, stderr
+
+ return output.Output(
+ process.returncode,
+ timeout_result[0],
+ stdout,
+ stderr,
+ process.pid,
+ )
def Execute(args, verbose=False, timeout=None):
args = [ c for c in args if c != "" ]
- exit_code, timed_out, stdout, stderr = RunProcess(
- verbose,
- timeout,
- args=args,
- )
- return output.Output(exit_code, timed_out, stdout, stderr)
+ return RunProcess(verbose, timeout, args=args)
diff --git a/deps/v8/tools/testrunner/local/execution.py b/deps/v8/tools/testrunner/local/execution.py
index 0d90ab8d0d..e0aec0bb90 100644
--- a/deps/v8/tools/testrunner/local/execution.py
+++ b/deps/v8/tools/testrunner/local/execution.py
@@ -49,9 +49,8 @@ TEST_DIR = os.path.join(BASE_DIR, "test")
class Instructions(object):
- def __init__(self, command, dep_command, test_id, timeout, verbose):
+ def __init__(self, command, test_id, timeout, verbose):
self.command = command
- self.dep_command = dep_command
self.id = test_id
self.timeout = timeout
self.verbose = verbose
@@ -112,12 +111,7 @@ def _GetInstructions(test, context):
# the like.
if statusfile.IsSlow(test.outcomes or [statusfile.PASS]):
timeout *= 2
- if test.dependency is not None:
- dep_command = [ c.replace(test.path, test.dependency) for c in command ]
- else:
- dep_command = None
- return Instructions(
- command, dep_command, test.id, timeout, context.verbose)
+ return Instructions(command, test.id, timeout, context.verbose)
class Job(object):
@@ -143,13 +137,33 @@ def SetupProblem(exception, test):
# Extra debuging information when files are claimed missing.
f = match.group(1)
stderr += ">>> File %s exists? -> %s\n" % (f, os.path.exists(f))
- return test.id, output.Output(1, False, "", stderr), 0
+ return test.id, output.Output(1, False, "", stderr, None), 0
class TestJob(Job):
def __init__(self, test):
self.test = test
+ def _rename_coverage_data(self, output, context):
+ """Rename coverage data.
+
+ Rename files with PIDs to files with unique test IDs, because the number
+ of tests might be higher than pid_max. E.g.:
+ d8.1234.sancov -> d8.test.1.sancov, where 1234 was the process' PID
+ and 1 is the test ID.
+ """
+ if context.sancov_dir and output.pid is not None:
+ sancov_file = os.path.join(
+ context.sancov_dir, "%s.%d.sancov" % (self.test.shell(), output.pid))
+
+ # Some tests are expected to fail and don't produce coverage data.
+ if os.path.exists(sancov_file):
+ parts = sancov_file.split(".")
+ new_sancov_file = ".".join(
+ parts[:-2] + ["test", str(self.test.id)] + parts[-1:])
+ assert not os.path.exists(new_sancov_file)
+ os.rename(sancov_file, new_sancov_file)
+
def Run(self, process_context):
try:
# Retrieve a new suite object on the worker-process side. The original
@@ -160,16 +174,8 @@ class TestJob(Job):
return SetupProblem(e, self.test)
start_time = time.time()
- if instr.dep_command is not None:
- dep_output = commands.Execute(
- instr.dep_command, instr.verbose, instr.timeout)
- # TODO(jkummerow): We approximate the test suite specific function
- # IsFailureOutput() by just checking the exit code here. Currently
- # only cctests define dependencies, for which this simplification is
- # correct.
- if dep_output.exit_code != 0:
- return (instr.id, dep_output, time.time() - start_time)
output = commands.Execute(instr.command, instr.verbose, instr.timeout)
+ self._rename_coverage_data(output, process_context.context)
return (instr.id, output, time.time() - start_time)
diff --git a/deps/v8/tools/testrunner/local/statusfile.py b/deps/v8/tools/testrunner/local/statusfile.py
index f86106b9d9..7e96cc3715 100644
--- a/deps/v8/tools/testrunner/local/statusfile.py
+++ b/deps/v8/tools/testrunner/local/statusfile.py
@@ -35,7 +35,6 @@ OKAY = "OKAY"
TIMEOUT = "TIMEOUT"
CRASH = "CRASH"
SLOW = "SLOW"
-FLAKY = "FLAKY"
FAST_VARIANTS = "FAST_VARIANTS"
NO_VARIANTS = "NO_VARIANTS"
# These are just for the status files and are mapped below in DEFS:
@@ -46,7 +45,7 @@ FAIL_SLOPPY = "FAIL_SLOPPY"
ALWAYS = "ALWAYS"
KEYWORDS = {}
-for key in [SKIP, FAIL, PASS, OKAY, TIMEOUT, CRASH, SLOW, FLAKY, FAIL_OK,
+for key in [SKIP, FAIL, PASS, OKAY, TIMEOUT, CRASH, SLOW, FAIL_OK,
FAST_VARIANTS, NO_VARIANTS, PASS_OR_FAIL, FAIL_SLOPPY, ALWAYS]:
KEYWORDS[key] = key
@@ -59,7 +58,7 @@ for var in ["debug", "release", "big", "little",
"android_arm", "android_arm64", "android_ia32", "android_x87",
"android_x64", "arm", "arm64", "ia32", "mips", "mipsel", "mips64",
"mips64el", "x64", "x87", "nacl_ia32", "nacl_x64", "ppc", "ppc64",
- "macos", "windows", "linux", "aix"]:
+ "s390", "s390x", "macos", "windows", "linux", "aix"]:
VARIABLES[var] = var
@@ -79,10 +78,6 @@ def OnlyFastVariants(outcomes):
return FAST_VARIANTS in outcomes
-def IsFlaky(outcomes):
- return FLAKY in outcomes
-
-
def IsPassOrFail(outcomes):
return ((PASS in outcomes) and (FAIL in outcomes) and
(not CRASH in outcomes) and (not OKAY in outcomes))
diff --git a/deps/v8/tools/testrunner/local/testsuite.py b/deps/v8/tools/testrunner/local/testsuite.py
index 55e0eb21ae..f43d008b22 100644
--- a/deps/v8/tools/testrunner/local/testsuite.py
+++ b/deps/v8/tools/testrunner/local/testsuite.py
@@ -102,7 +102,6 @@ class TestSuite(object):
def __init__(self, name, root):
# Note: This might be called concurrently from different processes.
- # Changing harddisk state should be done in 'SetupWorkingDirectory' below.
self.name = name # string
self.root = root # string containing path
self.tests = None # list of TestCase objects
@@ -110,11 +109,6 @@ class TestSuite(object):
self.wildcards = None # dictionary mapping test paths to list of outcomes
self.total_duration = None # float, assigned on demand
- def SetupWorkingDirectory(self):
- # This is called once per test suite object in a multi-process setting.
- # Multi-process-unsafe work-directory setup can go here.
- pass
-
def shell(self):
return "d8"
@@ -159,10 +153,6 @@ class TestSuite(object):
self.tests = self.ListTests(context)
@staticmethod
- def _FilterFlaky(flaky, mode):
- return (mode == "run" and not flaky) or (mode == "skip" and flaky)
-
- @staticmethod
def _FilterSlow(slow, mode):
return (mode == "run" and not slow) or (mode == "skip" and slow)
@@ -171,13 +161,11 @@ class TestSuite(object):
return (mode == "run" and not pass_fail) or (mode == "skip" and pass_fail)
def FilterTestCasesByStatus(self, warn_unused_rules,
- flaky_tests="dontcare",
slow_tests="dontcare",
pass_fail_tests="dontcare"):
filtered = []
used_rules = set()
for t in self.tests:
- flaky = False
slow = False
pass_fail = False
testname = self.CommonTestName(t)
@@ -191,7 +179,6 @@ class TestSuite(object):
for outcome in t.outcomes:
if outcome.startswith('Flags: '):
t.flags += outcome[7:].split()
- flaky = statusfile.IsFlaky(t.outcomes)
slow = statusfile.IsSlow(t.outcomes)
pass_fail = statusfile.IsPassOrFail(t.outcomes)
skip = False
@@ -203,10 +190,9 @@ class TestSuite(object):
if statusfile.DoSkip(t.outcomes):
skip = True
break # "for rule in self.wildcards"
- flaky = flaky or statusfile.IsFlaky(t.outcomes)
slow = slow or statusfile.IsSlow(t.outcomes)
pass_fail = pass_fail or statusfile.IsPassOrFail(t.outcomes)
- if (skip or self._FilterFlaky(flaky, flaky_tests)
+ if (skip
or self._FilterSlow(slow, slow_tests)
or self._FilterPassFail(pass_fail, pass_fail_tests)):
continue # "for t in self.tests"
@@ -262,14 +248,14 @@ class TestSuite(object):
def GetSourceForTest(self, testcase):
return "(no source available)"
- def IsFailureOutput(self, output, testpath):
- return output.exit_code != 0
+ def IsFailureOutput(self, testcase):
+ return testcase.output.exit_code != 0
def IsNegativeTest(self, testcase):
return False
def HasFailed(self, testcase):
- execution_failed = self.IsFailureOutput(testcase.output, testcase.path)
+ execution_failed = self.IsFailureOutput(testcase)
if self.IsNegativeTest(testcase):
return not execution_failed
else:
@@ -328,9 +314,9 @@ class GoogleTestSuite(TestSuite):
if test_desc.endswith('.'):
test_case = test_desc
elif test_case and test_desc:
- test = testcase.TestCase(self, test_case + test_desc, dependency=None)
+ test = testcase.TestCase(self, test_case + test_desc)
tests.append(test)
- tests.sort()
+ tests.sort(key=lambda t: t.path)
return tests
def GetFlagsForTestCase(self, testcase, context):
diff --git a/deps/v8/tools/testrunner/local/utils.py b/deps/v8/tools/testrunner/local/utils.py
index cb6c350e4e..c880dfc34e 100644
--- a/deps/v8/tools/testrunner/local/utils.py
+++ b/deps/v8/tools/testrunner/local/utils.py
@@ -102,6 +102,8 @@ def DefaultArch():
return 'ia32'
elif machine == 'amd64':
return 'ia32'
+ elif machine == 's390x':
+ return 's390'
elif machine == 'ppc64':
return 'ppc'
else:
diff --git a/deps/v8/tools/testrunner/objects/context.py b/deps/v8/tools/testrunner/objects/context.py
index c9853d07cc..6bcbfb67aa 100644
--- a/deps/v8/tools/testrunner/objects/context.py
+++ b/deps/v8/tools/testrunner/objects/context.py
@@ -30,7 +30,7 @@ class Context():
def __init__(self, arch, mode, shell_dir, mode_flags, verbose, timeout,
isolates, command_prefix, extra_flags, noi18n, random_seed,
no_sorting, rerun_failures_count, rerun_failures_max,
- predictable, no_harness, use_perf_data):
+ predictable, no_harness, use_perf_data, sancov_dir):
self.arch = arch
self.mode = mode
self.shell_dir = shell_dir
@@ -48,13 +48,14 @@ class Context():
self.predictable = predictable
self.no_harness = no_harness
self.use_perf_data = use_perf_data
+ self.sancov_dir = sancov_dir
def Pack(self):
return [self.arch, self.mode, self.mode_flags, self.timeout, self.isolates,
self.command_prefix, self.extra_flags, self.noi18n,
self.random_seed, self.no_sorting, self.rerun_failures_count,
self.rerun_failures_max, self.predictable, self.no_harness,
- self.use_perf_data]
+ self.use_perf_data, self.sancov_dir]
@staticmethod
def Unpack(packed):
@@ -62,4 +63,4 @@ class Context():
return Context(packed[0], packed[1], None, packed[2], False,
packed[3], packed[4], packed[5], packed[6], packed[7],
packed[8], packed[9], packed[10], packed[11], packed[12],
- packed[13], packed[14])
+ packed[13], packed[14], packed[15])
diff --git a/deps/v8/tools/testrunner/objects/output.py b/deps/v8/tools/testrunner/objects/output.py
index 87b4c84e19..b4bb01f797 100644
--- a/deps/v8/tools/testrunner/objects/output.py
+++ b/deps/v8/tools/testrunner/objects/output.py
@@ -32,11 +32,12 @@ from ..local import utils
class Output(object):
- def __init__(self, exit_code, timed_out, stdout, stderr):
+ def __init__(self, exit_code, timed_out, stdout, stderr, pid):
self.exit_code = exit_code
self.timed_out = timed_out
self.stdout = stdout
self.stderr = stderr
+ self.pid = pid
def HasCrashed(self):
if utils.IsWindows():
@@ -52,9 +53,9 @@ class Output(object):
return self.timed_out
def Pack(self):
- return [self.exit_code, self.timed_out, self.stdout, self.stderr]
+ return [self.exit_code, self.timed_out, self.stdout, self.stderr, self.pid]
@staticmethod
def Unpack(packed):
# For the order of the fields, refer to Pack() above.
- return Output(packed[0], packed[1], packed[2], packed[3])
+ return Output(packed[0], packed[1], packed[2], packed[3], packed[4])
diff --git a/deps/v8/tools/testrunner/objects/testcase.py b/deps/v8/tools/testrunner/objects/testcase.py
index b91f8b4b56..113c624a35 100644
--- a/deps/v8/tools/testrunner/objects/testcase.py
+++ b/deps/v8/tools/testrunner/objects/testcase.py
@@ -30,12 +30,11 @@ from . import output
class TestCase(object):
def __init__(self, suite, path, variant='default', flags=None,
- dependency=None, override_shell=None):
+ override_shell=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.override_shell = override_shell
self.outcomes = set([])
self.output = None
@@ -45,7 +44,7 @@ class TestCase(object):
def CopyAddingFlags(self, variant, flags):
copy = TestCase(self.suite, self.path, variant, self.flags + flags,
- self.dependency, self.override_shell)
+ self.override_shell)
copy.outcomes = self.outcomes
return copy
@@ -56,16 +55,16 @@ class TestCase(object):
"""
assert self.id is not None
return [self.suitename(), self.path, self.variant, self.flags,
- self.dependency, self.override_shell, list(self.outcomes or []),
+ self.override_shell, 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], task[4], task[5])
- test.outcomes = set(task[6])
- test.id = task[7]
+ 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
@@ -101,3 +100,11 @@ class TestCase(object):
send the name only and retrieve a process-local suite later.
"""
return dict(self.__dict__, suite=self.suite.name)
+
+ def __cmp__(self, other):
+ # Make sure that test cases are sorted correctly if sorted without
+ # key function. But using a key function is preferred for speed.
+ return cmp(
+ (self.suite.name, self.path, self.flags),
+ (other.suite.name, other.path, other.flags),
+ )
diff --git a/deps/v8/tools/testrunner/testrunner.isolate b/deps/v8/tools/testrunner/testrunner.isolate
index 669614b283..1e8e9dccb9 100644
--- a/deps/v8/tools/testrunner/testrunner.isolate
+++ b/deps/v8/tools/testrunner/testrunner.isolate
@@ -11,4 +11,14 @@
'./'
],
},
-} \ No newline at end of file
+ 'conditions': [
+ ['coverage==1 and sanitizer_coverage=="bb"', {
+ 'variables': {
+ 'files': [
+ '../sanitizers/sancov_merger.py',
+ '../../third_party/llvm/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py',
+ ],
+ },
+ }],
+ ],
+}