diff options
author | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-04 10:32:49 +0000 |
---|---|---|
committer | glider@chromium.org <glider@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-04 10:32:49 +0000 |
commit | a367a3bf41d61bea9c7dc73205815d2ee4091d87 (patch) | |
tree | 9973c53409d1831085288f28806fdebdd771f696 /tools/valgrind/test_suppressions.py | |
parent | 8101ef03ff6f84be3dd58dfb47760396553b09ba (diff) | |
download | chromium_src-a367a3bf41d61bea9c7dc73205815d2ee4091d87.zip chromium_src-a367a3bf41d61bea9c7dc73205815d2ee4091d87.tar.gz chromium_src-a367a3bf41d61bea9c7dc73205815d2ee4091d87.tar.bz2 |
Sheriff's little helper should print the report URLs.
TBR=timurrrr
Review URL: http://codereview.chromium.org/3030044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/valgrind/test_suppressions.py')
-rw-r--r-- | tools/valgrind/test_suppressions.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/tools/valgrind/test_suppressions.py b/tools/valgrind/test_suppressions.py index cf9eaca..ffb70f2 100644 --- a/tools/valgrind/test_suppressions.py +++ b/tools/valgrind/test_suppressions.py @@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +from collections import defaultdict import os import re import sys @@ -13,7 +14,7 @@ import suppressions def ReadReportsFromFile(filename): input_file = file(filename, 'r') - ret = [] + reports = [] in_suppression = False cur_supp = [] for line in input_file: @@ -25,7 +26,7 @@ def ReadReportsFromFile(filename): if in_suppression: if line == "}": cur_supp += ["}"] - ret += ["\n".join(cur_supp)] + reports += ["\n".join(cur_supp)] in_suppression = False cur_supp = [] else: @@ -33,7 +34,7 @@ def ReadReportsFromFile(filename): elif line == "{": in_suppression = True cur_supp = ["{"] - return ret + return reports,line filenames = [ "memcheck/suppressions.txt", @@ -47,14 +48,16 @@ for f in filenames: supp_filename = os.path.join(suppressions_root, f) all_suppressions += suppressions.ReadSuppressionsFromFile(supp_filename) -reports = [] +# all_reports is a map {report: list of urls containing this report} +all_reports = defaultdict(list) + for f in sys.argv[1:]: - reports += ReadReportsFromFile(f) -reports = set(reports) -# TODO(timurrrr): For each reports, keep a list of files containing it. + f_reports, url = ReadReportsFromFile(f) + for report in f_reports: + all_reports[report] += [url] reports_count = 0 -for r in reports: +for r in all_reports: match = False for s in all_suppressions: if s.Match(r.split("\n")): @@ -63,7 +66,10 @@ for r in reports: if not match: reports_count += 1 print "===================================" - print "This report didn't match any suppressions:" + print "This report observed in:" + for url in all_reports[r]: + print " %s" % url + print "didn't match any suppressions:" print r print "===================================" |