Posted to tcl by miguel at Mon Aug 04 17:28:30 GMT 2008view raw
- #!./tclsh
- set sep ยบ
- if {[llength $argv]} {
- set files $argv
- } else {
- set files [lsort [glob ../tests/*.test]]
- }
- #puts [llength $argv]$files; return
- set f stdout
- set script {
- catch {source $file}
- proc exit args {}
- }
- set exclude {clock.test}
- set i 0
- foreach file $files {
- set dont 0
- if {[info exists exclude] \
- && [string length $exclude] \
- && [string match [file tail $file] $exclude]} {
- continue
- }
- set res {}
- puts stderr "starting $file"
- catch {
- exec /usr/bin/valgrind --leak-check=yes --num-callers=10 \
- --show-reachable=yes ./tcltest << [subst $script]
- } msg
- regexp {definitely lost: *[1-9][^\n]*} $msg res
- set res $msg
- if {$res ne {}} {
- #puts $f "$file: $res"
- puts $f "$sep $file\n$msg\n"
- flush $f
- }
- #if {[incr i] >2} break
- }
- proc exit args {}