Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: tools/foozzie/v8_suppressions.py

Issue 2635923002: [foozzie] Refactoring - move source hashing to main script (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/foozzie/v8_foozzie_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/foozzie/v8_suppressions.py
diff --git a/tools/foozzie/v8_suppressions.py b/tools/foozzie/v8_suppressions.py
index 9086b540d3494531f55968d745604b28322c2849..7786cda39f497aad3052657e2003e71426286756 100644
--- a/tools/foozzie/v8_suppressions.py
+++ b/tools/foozzie/v8_suppressions.py
@@ -24,7 +24,6 @@ Alternatively, think about adding a behavior change to v8_suppressions.js
to silence a particular class of problems.
"""
-import hashlib
import itertools
import re
@@ -140,12 +139,7 @@ IGNORE_LINES = [
ALLOWED_LINE_DIFFS = [re.compile(exp) for exp in ALLOWED_LINE_DIFFS]
IGNORE_LINES = [re.compile(exp) for exp in IGNORE_LINES]
-# The number of hex digits used from the hash of the original source file path.
-# Keep the number small to avoid duplicate explosion.
-SOURCE_HASH_LENGTH = 3
-
ORIGINAL_SOURCE_PREFIX = 'v8-foozzie source: '
-ORIGINAL_SOURCE_DEFAULT = 'none'
def line_pairs(lines):
return itertools.izip_longest(
@@ -183,15 +177,13 @@ def ignore_by_regexp(line1, line2, allowed):
def diff_output(output1, output2, allowed, ignore1, ignore2):
- """Returns a tuple (difference, source, source_key).
+ """Returns a tuple (difference, source).
The difference is None if there's no difference, otherwise a string
with a readable diff.
- The source is the last source output within the test case. It is the string
- 'none' if no such output existed.
-
- The source_key is a short hash of source or 'none'.
+ The source is the last source output within the test case, or None if no
+ such output existed.
"""
def useful_line(ignore):
def fun(line):
@@ -203,8 +195,7 @@ def diff_output(output1, output2, allowed, ignore1, ignore2):
# This keeps track where we are in the original source file of the fuzz
# test case.
- source = ORIGINAL_SOURCE_DEFAULT
- source_key = ORIGINAL_SOURCE_DEFAULT
+ source = None
for ((line1, lookahead1), (line2, lookahead2)) in itertools.izip_longest(
line_pairs(lines1), line_pairs(lines2), fillvalue=(None, None)):
@@ -214,9 +205,9 @@ def diff_output(output1, output2, allowed, ignore1, ignore2):
# One iterator ends earlier.
if line1 is None:
- return '+ %s' % short_line_output(line2), source, source_key
+ return '+ %s' % short_line_output(line2), source
if line2 is None:
- return '- %s' % short_line_output(line1), source, source_key
+ return '- %s' % short_line_output(line1), source
# If lines are equal, no further checks are necessary.
if line1 == line2:
@@ -225,7 +216,6 @@ def diff_output(output1, output2, allowed, ignore1, ignore2):
# are equal.
if line1.startswith(ORIGINAL_SOURCE_PREFIX):
source = line1[len(ORIGINAL_SOURCE_PREFIX):]
- source_key = hashlib.sha1(source).hexdigest()[:SOURCE_HASH_LENGTH]
continue
# Look ahead. If next line is a caret, ignore this line.
@@ -240,11 +230,10 @@ def diff_output(output1, output2, allowed, ignore1, ignore2):
return (
'- %s\n+ %s' % (short_line_output(line1), short_line_output(line2)),
source,
- source_key,
)
# No difference found.
- return None, source, source_key
+ return None, source
def get_suppression(arch1, config1, arch2, config2):
« no previous file with comments | « tools/foozzie/v8_foozzie_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698