3
# Copyright (C) 2010 Monty Taylor
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; version 2 of the License.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
in_leak_summary= False
21
new_current_test= True
26
for line in open('var/log/master.err','r').readlines():
27
if line[:12] == "CURRENT_TEST":
28
current_test= line.split()[1]
32
if line.strip() == "{":
34
results.append("Suppression:\n{\n")
36
if line.strip() == "}":
47
valgrind_command= line.split("==")[2]
48
if valgrind_command[1:5] == "LEAK":
53
if valgrind_command[1:6] in ("Copyr","Using","Comma","Memch","For c","ERROR","HEAP "," i"," tot", "Threa","Warni"):
55
if len(valgrind_command.strip()) > 0:
57
summary[current_test]=1
58
total_warning_count += 1
59
new_current_test = False
60
results.append("\n\n************")
61
results.append(current_test)
62
results.append("************\n\n")
63
new_current_test = False
64
elif valgrind_command[1] != " ":
65
summary[current_test] += 1
66
total_warning_count += 1
68
results.append(valgrind_command)
70
warning_count=open("total_warning_count","w")
71
warning_count.write(str(total_warning_count))
72
warning_count.write("\n")
75
outfile=open('stripped_log','w')
76
outfile.write("Total warnings:")
77
outfile.write(str(total_warning_count))
80
for k,v in summary.items():
82
outfile.write(" warnings in ")