diff options
author | Michaël Zasso <targos@protonmail.com> | 2019-08-16 11:32:46 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2019-08-19 09:25:23 +0200 |
commit | e31f0a7d25668d3c1531294d2ef44a9f3bde4ef4 (patch) | |
tree | 6c6bed9804be9df6162b2483f0a56f371f66464d /deps/v8/tools/testrunner | |
parent | ec16fdae540adaf710b1a86c620170b2880088f0 (diff) | |
download | node-new-e31f0a7d25668d3c1531294d2ef44a9f3bde4ef4.tar.gz |
deps: update V8 to 7.7.299.4
PR-URL: https://github.com/nodejs/node/pull/28918
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'deps/v8/tools/testrunner')
-rw-r--r-- | deps/v8/tools/testrunner/OWNERS | 2 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/base_runner.py | 14 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/local/junit_output.py | 49 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/local/testsuite.py | 22 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/local/variants.py | 1 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/outproc/message.py | 9 | ||||
-rwxr-xr-x | deps/v8/tools/testrunner/standard_runner.py | 17 | ||||
-rw-r--r-- | deps/v8/tools/testrunner/testproc/progress.py | 40 |
8 files changed, 36 insertions, 118 deletions
diff --git a/deps/v8/tools/testrunner/OWNERS b/deps/v8/tools/testrunner/OWNERS index 50b5741785..bdb1d555a4 100644 --- a/deps/v8/tools/testrunner/OWNERS +++ b/deps/v8/tools/testrunner/OWNERS @@ -1,3 +1 @@ -set noparent - file://INFRA_OWNERS diff --git a/deps/v8/tools/testrunner/base_runner.py b/deps/v8/tools/testrunner/base_runner.py index 525a198156..7f9b43435f 100644 --- a/deps/v8/tools/testrunner/base_runner.py +++ b/deps/v8/tools/testrunner/base_runner.py @@ -120,8 +120,9 @@ class ModeConfig(object): self.execution_mode = execution_mode -DEBUG_FLAGS = ["--nohard-abort", "--enable-slow-asserts", "--verify-heap"] -RELEASE_FLAGS = ["--nohard-abort"] +DEBUG_FLAGS = ["--nohard-abort", "--enable-slow-asserts", "--verify-heap", + "--testing-d8-test-runner"] +RELEASE_FLAGS = ["--nohard-abort", "--testing-d8-test-runner"] MODES = { "debug": ModeConfig( flags=DEBUG_FLAGS, @@ -348,9 +349,6 @@ class BaseTestRunner(object): "color, mono)") parser.add_option("--json-test-results", help="Path to a file for storing json results.") - parser.add_option("--junitout", help="File name of the JUnit output") - parser.add_option("--junittestsuite", default="v8tests", - help="The testsuite name in the JUnit output file") parser.add_option("--exit-after-n-failures", type="int", default=100, help="Exit after the first N failures instead of " "running all tests. Pass 0 to disable this feature.") @@ -561,6 +559,9 @@ class BaseTestRunner(object): asan_options.append('detect_leaks=1') else: asan_options.append('detect_leaks=0') + if utils.GuessOS() == 'windows': + # https://crbug.com/967663 + asan_options.append('detect_stack_use_after_return=0') os.environ['ASAN_OPTIONS'] = ":".join(asan_options) if self.build_config.cfi_vptr: @@ -790,9 +791,6 @@ class BaseTestRunner(object): def _create_progress_indicators(self, test_count, options): procs = [PROGRESS_INDICATORS[options.progress]()] - if options.junitout: - procs.append(progress.JUnitTestProgressIndicator(options.junitout, - options.junittestsuite)) if options.json_test_results: procs.append(progress.JsonTestProgressIndicator( self.framework_name, diff --git a/deps/v8/tools/testrunner/local/junit_output.py b/deps/v8/tools/testrunner/local/junit_output.py deleted file mode 100644 index 52f31ec422..0000000000 --- a/deps/v8/tools/testrunner/local/junit_output.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2013 the V8 project authors. All rights reserved. -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following -# disclaimer in the documentation and/or other materials provided -# with the distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -import xml.etree.ElementTree as xml - - -class JUnitTestOutput: - def __init__(self, test_suite_name): - self.root = xml.Element("testsuite") - self.root.attrib["name"] = test_suite_name - - def HasRunTest(self, test_name, test_cmd, test_duration, test_failure): - testCaseElement = xml.Element("testcase") - testCaseElement.attrib["name"] = test_name - testCaseElement.attrib["cmd"] = test_cmd - testCaseElement.attrib["time"] = str(round(test_duration, 3)) - if len(test_failure): - failureElement = xml.Element("failure") - failureElement.text = test_failure - testCaseElement.append(failureElement) - self.root.append(testCaseElement) - - def FinishAndWrite(self, f): - xml.ElementTree(self.root).write(f, "UTF-8") diff --git a/deps/v8/tools/testrunner/local/testsuite.py b/deps/v8/tools/testrunner/local/testsuite.py index 1bfc0317fe..864d7346fc 100644 --- a/deps/v8/tools/testrunner/local/testsuite.py +++ b/deps/v8/tools/testrunner/local/testsuite.py @@ -154,11 +154,18 @@ class GenericTestLoader(TestLoader): return [self.test_root] @property - def extension(self): - return "" + def extensions(self): + return [] + + def __find_extension(self, filename): + for extension in self.extensions: + if filename.endswith(extension): + return extension + + return False def _should_filter_by_name(self, filename): - if not filename.endswith(self.extension): + if not self.__find_extension(filename): return True for suffix in self.excluded_suffixes: @@ -171,10 +178,11 @@ class GenericTestLoader(TestLoader): return False def _filename_to_testname(self, filename): - if not self.extension: + extension = self.__find_extension(filename) + if not extension: return filename - return filename[:-len(self.extension)] + return filename[:-len(extension)] def _to_relpath(self, abspath, test_root): return os.path.relpath(abspath, test_root) @@ -197,8 +205,8 @@ class GenericTestLoader(TestLoader): class JSTestLoader(GenericTestLoader): @property - def extension(self): - return ".js" + def extensions(self): + return [".js", ".mjs"] class TestGenerator(object): diff --git a/deps/v8/tools/testrunner/local/variants.py b/deps/v8/tools/testrunner/local/variants.py index dc92db6099..4b0cf1553b 100644 --- a/deps/v8/tools/testrunner/local/variants.py +++ b/deps/v8/tools/testrunner/local/variants.py @@ -4,6 +4,7 @@ # Use this to run several variants of the tests. ALL_VARIANT_FLAGS = { + "assert_types": [["--assert-types"]], "code_serializer": [["--cache=code"]], "default": [[]], "future": [["--future"]], diff --git a/deps/v8/tools/testrunner/outproc/message.py b/deps/v8/tools/testrunner/outproc/message.py index bbfc1cdf7e..f196cfd614 100644 --- a/deps/v8/tools/testrunner/outproc/message.py +++ b/deps/v8/tools/testrunner/outproc/message.py @@ -32,8 +32,15 @@ class OutProc(base.OutProc): if len(expected_lines) != len(actual_lines): return True + # Try .js first, and fall back to .mjs. + # TODO(v8:9406): clean this up by never separating the path from + # the extension in the first place. + base_path = self._basepath + '.js' + if not os.path.exists(base_path): + base_path = self._basepath + '.mjs' + env = { - 'basename': os.path.basename(self._basepath + '.js'), + 'basename': os.path.basename(base_path), } for (expected, actual) in itertools.izip_longest( expected_lines, actual_lines, fillvalue=''): diff --git a/deps/v8/tools/testrunner/standard_runner.py b/deps/v8/tools/testrunner/standard_runner.py index bc79c015bd..51e78608cb 100755 --- a/deps/v8/tools/testrunner/standard_runner.py +++ b/deps/v8/tools/testrunner/standard_runner.py @@ -9,7 +9,6 @@ from __future__ import print_function from functools import reduce import os -import re import sys # Adds testrunner to the path hence it has to be imported at the beggining. @@ -21,10 +20,8 @@ from testrunner.objects import predictable from testrunner.testproc.execution import ExecutionProc from testrunner.testproc.filter import StatusFileFilterProc, NameFilterProc from testrunner.testproc.loader import LoadProc -from testrunner.testproc.progress import ResultsTracker from testrunner.testproc.seed import SeedProc from testrunner.testproc.variant import VariantProc -from testrunner.utils import random_utils ARCH_GUESS = utils.DefaultArch() @@ -43,7 +40,7 @@ VARIANT_ALIASES = { 'dev': VARIANTS, # Additional variants, run on all bots. 'more': MORE_VARIANTS, - # Shortcut for the two above ('more' first - it has the longer running tests). + # Shortcut for the two above ('more' first - it has the longer running tests) 'exhaustive': MORE_VARIANTS + VARIANTS, # Additional variants, run on a subset of bots. 'extra': ['nooptimization', 'future', 'no_wasm_traps'], @@ -66,10 +63,10 @@ PREDICTABLE_WRAPPER = os.path.join( class StandardTestRunner(base_runner.BaseTestRunner): def __init__(self, *args, **kwargs): - super(StandardTestRunner, self).__init__(*args, **kwargs) + super(StandardTestRunner, self).__init__(*args, **kwargs) - self.sancov_dir = None - self._variants = None + self.sancov_dir = None + self._variants = None @property def framework_name(self): @@ -156,7 +153,6 @@ class StandardTestRunner(base_runner.BaseTestRunner): parser.add_option('--report', default=False, action='store_true', help='Print a summary of the tests to be run') - def _process_options(self, options): if options.sancov_dir: self.sancov_dir = options.sancov_dir @@ -224,7 +220,7 @@ class StandardTestRunner(base_runner.BaseTestRunner): self._variants = self._parse_variants(options.variants) def CheckTestMode(name, option): # pragma: no cover - if not option in ['run', 'skip', 'dontcare']: + if option not in ['run', 'skip', 'dontcare']: print('Unknown %s mode %s' % (name, option)) raise base_runner.TestRunnerError() CheckTestMode('slow test', options.slow_tests) @@ -319,7 +315,7 @@ class StandardTestRunner(base_runner.BaseTestRunner): self._prepare_procs(procs) - loader.load_initial_tests(initial_batch_size=options.j*2) + loader.load_initial_tests(initial_batch_size=options.j * 2) # This starts up worker processes and blocks until all tests are # processed. @@ -328,7 +324,6 @@ class StandardTestRunner(base_runner.BaseTestRunner): for indicator in indicators: indicator.finished() - if tests.test_count_estimate: percentage = float(results.total) / tests.test_count_estimate * 100 else: diff --git a/deps/v8/tools/testrunner/testproc/progress.py b/deps/v8/tools/testrunner/testproc/progress.py index 3ba10f9528..aad6740c1c 100644 --- a/deps/v8/tools/testrunner/testproc/progress.py +++ b/deps/v8/tools/testrunner/testproc/progress.py @@ -13,7 +13,6 @@ import sys import time from . import base -from ..local import junit_output # Base dir of the build products for Release and Debug. @@ -282,45 +281,6 @@ class MonochromeProgressIndicator(CompactProgressIndicator): print(("\r" + (" " * last_length) + "\r"), end='') -class JUnitTestProgressIndicator(ProgressIndicator): - def __init__(self, junitout, junittestsuite): - super(JUnitTestProgressIndicator, self).__init__() - self._requirement = base.DROP_PASS_STDOUT - - self.outputter = junit_output.JUnitTestOutput(junittestsuite) - if junitout: - self.outfile = open(junitout, "w") - else: - self.outfile = sys.stdout - - def _on_result_for(self, test, result): - # TODO(majeski): Support for dummy/grouped results - fail_text = "" - output = result.output - if result.has_unexpected_output: - stdout = output.stdout.strip() - if len(stdout): - fail_text += "stdout:\n%s\n" % stdout - stderr = output.stderr.strip() - if len(stderr): - fail_text += "stderr:\n%s\n" % stderr - fail_text += "Command: %s" % result.cmd.to_string() - if output.HasCrashed(): - fail_text += "exit code: %d\n--- CRASHED ---" % output.exit_code - if output.HasTimedOut(): - fail_text += "--- TIMEOUT ---" - self.outputter.HasRunTest( - test_name=str(test), - test_cmd=result.cmd.to_string(relative=True), - test_duration=output.duration, - test_failure=fail_text) - - def finished(self): - self.outputter.FinishAndWrite(self.outfile) - if self.outfile != sys.stdout: - self.outfile.close() - - class JsonTestProgressIndicator(ProgressIndicator): def __init__(self, framework_name, json_test_results, arch, mode): super(JsonTestProgressIndicator, self).__init__() |