[foozzie] Refactoring - simplify suppressions
This makes output and test-case suppressions independent of the used comparison configs and architecture. Such fine-grained suppressions were only needed during the inception of differential fuzzing, but by now, most remaining suppressions are implemented in d8 behind a flag. This prepares for running with more than two comparison configs in a follow up. No-Try: true Bug: chromium:1100114 Change-Id: I072769adb3ef7c6e6c43459aa23ac906f461b307 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2270095 Commit-Queue: Michael Achenbach <machenbach@chromium.org> Reviewed-by: Liviu Rau <liviurau@chromium.org> Reviewed-by: Tamer Tas <tmrts@chromium.org> Cr-Commit-Position: refs/heads/master@{#68579}
This commit is contained in:
parent
b33e2b6e94
commit
4146efbfe6
@ -370,13 +370,7 @@ def run_sanity_checks(options, suppress, first_cmd, second_cmd):
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
options = parse_args()
|
options = parse_args()
|
||||||
|
suppress = v8_suppressions.get_suppression(options.skip_suppressions)
|
||||||
# Suppressions are architecture and configuration specific.
|
|
||||||
suppress = v8_suppressions.get_suppression(
|
|
||||||
options.first.arch, options.first.config,
|
|
||||||
options.second.arch, options.second.config,
|
|
||||||
options.skip_suppressions,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Static bailout based on test case content or metadata.
|
# Static bailout based on test case content or metadata.
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
@ -409,8 +403,8 @@ def main():
|
|||||||
# Only bail out due to suppressed output if there was a difference. If a
|
# Only bail out due to suppressed output if there was a difference. If a
|
||||||
# suppression doesn't show up anymore in the statistics, we might want to
|
# suppression doesn't show up anymore in the statistics, we might want to
|
||||||
# remove it.
|
# remove it.
|
||||||
fail_bailout(first_config_output, suppress.ignore_by_output1)
|
fail_bailout(first_config_output, suppress.ignore_by_output)
|
||||||
fail_bailout(second_config_output, suppress.ignore_by_output2)
|
fail_bailout(second_config_output, suppress.ignore_by_output)
|
||||||
|
|
||||||
source_key = cluster_failures(source)
|
source_key = cluster_failures(source)
|
||||||
raise FailException(format_difference(
|
raise FailException(format_difference(
|
||||||
|
@ -120,8 +120,7 @@ class UnitTest(unittest.TestCase):
|
|||||||
|
|
||||||
def testDiff(self):
|
def testDiff(self):
|
||||||
def diff_fun(one, two, skip=False):
|
def diff_fun(one, two, skip=False):
|
||||||
suppress = v8_suppressions.get_suppression(
|
suppress = v8_suppressions.get_suppression(skip)
|
||||||
'x64', 'ignition', 'x64', 'ignition_turbo', skip)
|
|
||||||
return suppress.diff_lines(one.splitlines(), two.splitlines())
|
return suppress.diff_lines(one.splitlines(), two.splitlines())
|
||||||
|
|
||||||
one = ''
|
one = ''
|
||||||
|
@ -40,31 +40,23 @@ MAX_LINE_LENGTH = 512
|
|||||||
# For ignoring lines before carets and to ignore caret positions.
|
# For ignoring lines before carets and to ignore caret positions.
|
||||||
CARET_RE = re.compile(r'^\s*\^\s*$')
|
CARET_RE = re.compile(r'^\s*\^\s*$')
|
||||||
|
|
||||||
# Ignore by original source files. Map from bug->list of relative file paths in
|
# Ignore by original source files. Map from bug->list of relative file paths,
|
||||||
# V8, e.g. '/v8/test/mjsunit/d8-performance-now.js' including /v8/. A test will
|
# e.g. 'v8/test/mjsunit/d8-performance-now.js'. A test will be suppressed if
|
||||||
# be suppressed if one of the files below was used to mutate the test.
|
# one of the files below was used to mutate the test.
|
||||||
IGNORE_SOURCES = {
|
IGNORE_SOURCES = {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Ignore by test case pattern. Map from config->bug->regexp. Config '' is used
|
# Ignore by test case pattern. Map from bug->regexp.
|
||||||
# to match all configurations. Otherwise use either a compiler configuration,
|
|
||||||
# e.g. ignition or validate_asm or an architecture, e.g. x64 or ia32.
|
|
||||||
# Bug is preferred to be a crbug.com/XYZ, but can be any short distinguishable
|
# Bug is preferred to be a crbug.com/XYZ, but can be any short distinguishable
|
||||||
# label.
|
# label.
|
||||||
# Regular expressions are assumed to be compiled. We use regexp.search.
|
# Regular expressions are assumed to be compiled. We use regexp.search.
|
||||||
IGNORE_TEST_CASES = {
|
IGNORE_TEST_CASES = {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Ignore by output pattern. Map from config->bug->regexp. See IGNORE_TEST_CASES
|
# Ignore by output pattern. Map from bug->regexp like above.
|
||||||
# on how to specify config keys.
|
|
||||||
# Bug is preferred to be a crbug.com/XYZ, but can be any short distinguishable
|
|
||||||
# label.
|
|
||||||
# Regular expressions are assumed to be compiled. We use regexp.search.
|
|
||||||
IGNORE_OUTPUT = {
|
IGNORE_OUTPUT = {
|
||||||
'': {
|
'crbug.com/689877':
|
||||||
'crbug.com/689877':
|
re.compile(r'^.*SyntaxError: .*Stack overflow$', re.M),
|
||||||
re.compile(r'^.*SyntaxError: .*Stack overflow$', re.M),
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Lines matching any of the following regular expressions will be ignored
|
# Lines matching any of the following regular expressions will be ignored
|
||||||
@ -216,33 +208,12 @@ def diff_output(output1, output2, allowed, ignore1, ignore2):
|
|||||||
return None, source
|
return None, source
|
||||||
|
|
||||||
|
|
||||||
def get_suppression(arch1, config1, arch2, config2, skip=False):
|
def get_suppression(skip=False):
|
||||||
return V8Suppression(arch1, config1, arch2, config2, skip)
|
return V8Suppression(skip)
|
||||||
|
|
||||||
|
|
||||||
class Suppression(object):
|
class V8Suppression(object):
|
||||||
def diff(self, output1, output2):
|
def __init__(self, skip):
|
||||||
return None
|
|
||||||
|
|
||||||
def ignore_by_metadata(self, metadata):
|
|
||||||
return None
|
|
||||||
|
|
||||||
def ignore_by_content(self, testcase):
|
|
||||||
return None
|
|
||||||
|
|
||||||
def ignore_by_output1(self, output):
|
|
||||||
return None
|
|
||||||
|
|
||||||
def ignore_by_output2(self, output):
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
class V8Suppression(Suppression):
|
|
||||||
def __init__(self, arch1, config1, arch2, config2, skip):
|
|
||||||
self.arch1 = arch1
|
|
||||||
self.config1 = config1
|
|
||||||
self.arch2 = arch2
|
|
||||||
self.config2 = config2
|
|
||||||
if skip:
|
if skip:
|
||||||
self.allowed_line_diffs = []
|
self.allowed_line_diffs = []
|
||||||
self.ignore_output = {}
|
self.ignore_output = {}
|
||||||
@ -277,10 +248,9 @@ class V8Suppression(Suppression):
|
|||||||
# Search the whole test case if preamble can't be found. E.g. older
|
# Search the whole test case if preamble can't be found. E.g. older
|
||||||
# already minimized test cases might have dropped the delimiter line.
|
# already minimized test cases might have dropped the delimiter line.
|
||||||
content = testcase
|
content = testcase
|
||||||
for key in ['', self.arch1, self.arch2, self.config1, self.config2]:
|
for bug, exp in IGNORE_TEST_CASES.items():
|
||||||
for bug, exp in IGNORE_TEST_CASES.get(key, {}).items():
|
if exp.search(content):
|
||||||
if exp.search(content):
|
return bug
|
||||||
return bug
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def ignore_by_metadata(self, metadata):
|
def ignore_by_metadata(self, metadata):
|
||||||
@ -290,20 +260,13 @@ class V8Suppression(Suppression):
|
|||||||
return bug
|
return bug
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def ignore_by_output1(self, output):
|
def ignore_by_output(self, output):
|
||||||
return self.ignore_by_output(output, self.arch1, self.config1)
|
|
||||||
|
|
||||||
def ignore_by_output2(self, output):
|
|
||||||
return self.ignore_by_output(output, self.arch2, self.config2)
|
|
||||||
|
|
||||||
def ignore_by_output(self, output, arch, config):
|
|
||||||
def check(mapping):
|
def check(mapping):
|
||||||
for bug, exp in mapping.items():
|
for bug, exp in mapping.items():
|
||||||
if exp.search(output):
|
if exp.search(output):
|
||||||
return bug
|
return bug
|
||||||
return None
|
return None
|
||||||
for key in ['', arch, config]:
|
bug = check(self.ignore_output)
|
||||||
bug = check(self.ignore_output.get(key, {}))
|
if bug:
|
||||||
if bug:
|
return bug
|
||||||
return bug
|
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user