Commit 05891277 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(check_valgrind): The expected_leaks argument should now include the

	number of suppressed memory leaks.  Ignore up to 25 suppressed
	leaks.  Don't ignore any reachable leaks.
parent 49b2f96b
......@@ -847,10 +847,11 @@ proc parse_valgrind_leak {f} {
proc check_valgrind {logfile need_leaks need_errs expected_leaks} {
# The "expected_leaks" argument should be a such as:
#
# {"Bug 99 & Bug 93" 4 3 9}
# {"Bug 99 & Bug 93" 4 3 9 11}
#
# that indicates that due to Bug 99 and Bug 93 there will be 4
# definite leaks, 3 possible leaks, and 9 still reachable blocks.
# definite leaks, 3 possible leaks, 9 still reachable blocks, and
# 11 suppressed leaks.
global valgrindix
global valgrind
......@@ -891,30 +892,34 @@ proc check_valgrind {logfile need_leaks need_errs expected_leaks} {
set definite [parse_valgrind_leak $f]
set possible [parse_valgrind_leak $f]
set reachable [parse_valgrind_leak $f]
set suppressed [parse_valgrind_leak $f]
if {$expected_leaks != {}} {
set xreason [lindex $expected_leaks 0]
set exp_def [lindex $expected_leaks 1]
set exp_pos [lindex $expected_leaks 2]
set exp_rea [lindex $expected_leaks 3]
set exp_sup [lindex $expected_leaks 4]
setup_xfail "*-*-*" $xreason
if {$exp_def == $definite
&& $exp_pos == $possible
&& $exp_rea == $reachable} {
&& $exp_rea == $reachable
&& $exp_sup == $suppressed} {
fail "memory leaks: $definite definite, $possible possible"
set definite 0
set possible 0
set reachable 0
set suppressed 0
} else {
pass "wrong memory leak count found"
}
}
set leakcount [expr $definite + $possible]
# Ignore up to 25 reachable blocks. libc leaks some blocks...
if {$reachable > 25} {
set leakcount "$reachable"
set leakcount [expr $definite + $possible + $reachable]
# Ignore up to 25 suppressed blocks.
if {$suppressed > 25} {
set leakcount "$suppressed"
}
}
if {[regexp "No malloc'd blocks -- no leaks are possible" $line]} {
......@@ -953,6 +958,10 @@ proc check_valgrind {logfile need_leaks need_errs expected_leaks} {
fail "valgrind found $reachable reachable blocks. See $saved."
set keep 1
}
if {$suppressed} {
fail "valgrind found $suppressed suppressed blocks. See $saved."
set keep 1
}
}
if {$keep == 0} {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment