OLD | NEW |
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from collections import defaultdict | 5 from collections import defaultdict |
6 import os | 6 import os |
7 import re | 7 import re |
8 import sys | 8 import sys |
9 | 9 |
10 import path_utils | 10 import path_utils |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 report_hashes = {} | 61 report_hashes = {} |
62 | 62 |
63 for f in sys.argv[1:]: | 63 for f in sys.argv[1:]: |
64 f_reports, url = ReadReportsFromFile(f) | 64 f_reports, url = ReadReportsFromFile(f) |
65 for (hash, report) in f_reports: | 65 for (hash, report) in f_reports: |
66 all_reports[report] += [url] | 66 all_reports[report] += [url] |
67 report_hashes[report] = hash | 67 report_hashes[report] = hash |
68 | 68 |
69 reports_count = 0 | 69 reports_count = 0 |
70 for r in all_reports: | 70 for r in all_reports: |
71 if set([False]) == set([not re.search("%20Mac%20", url)\ | 71 if set([False]) == set([not re.search("%20Mac%20|mac_valgrind", url)\ |
72 for url in all_reports[r]]): | 72 for url in all_reports[r]]): |
73 # Include mac suppressions if the report is only present on Mac | 73 # Include mac suppressions if the report is only present on Mac |
74 cur_supp = common_suppressions + mac_suppressions | 74 cur_supp = common_suppressions + mac_suppressions |
75 else: | 75 else: |
76 cur_supp = common_suppressions | 76 cur_supp = common_suppressions |
77 | 77 |
78 match = False | 78 match = False |
79 for s in cur_supp: | 79 for s in cur_supp: |
80 if s.Match(r.split("\n")): | 80 if s.Match(r.split("\n")): |
81 match = True | 81 match = True |
82 break | 82 break |
83 if not match: | 83 if not match: |
84 reports_count += 1 | 84 reports_count += 1 |
85 print "===================================" | 85 print "===================================" |
86 print "This report observed at" | 86 print "This report observed at" |
87 for url in all_reports[r]: | 87 for url in all_reports[r]: |
88 print " %s" % url | 88 print " %s" % url |
89 print "didn't match any suppressions:" | 89 print "didn't match any suppressions:" |
90 print "Suppression (error hash=#%s#):" % (report_hashes[r]) | 90 print "Suppression (error hash=#%s#):" % (report_hashes[r]) |
91 print r | 91 print r |
92 print "===================================" | 92 print "===================================" |
93 | 93 |
94 if reports_count > 0: | 94 if reports_count > 0: |
95 print "%d unique reports don't match any of the suppressions" % reports_count | 95 print "%d unique reports don't match any of the suppressions" % reports_count |
96 else: | 96 else: |
97 print "Congratulations! All reports are suppressed!" | 97 print "Congratulations! All reports are suppressed!" |
98 # TODO(timurrrr): also make sure none of the old suppressions | 98 # TODO(timurrrr): also make sure none of the old suppressions |
99 # were narrowed too much. | 99 # were narrowed too much. |
OLD | NEW |