1 # Run all tests in the current directory
3 # Tests are run in a sub-interpreter (if possible) to avoid
4 # interactions between tests.
8 if {[info commands
interp] eq
""} {
10 foreach script
[lsort [glob *.test
]] {
12 exec [info nameofexecutable
] $script >@stdout
2>@stderr
15 puts "Failed: $script"
20 array set total
{pass
0 fail
0 skip
0 tests
0}
21 foreach script
[lsort [glob *.test
]] {
26 foreach var
{argv0 auto_path
} {
27 $i eval [list set $var [set ::$var]]
31 catch -exit {$i eval source $script} msg opts
32 if {[info returncode
$opts(-code)] eq
"error"} {
33 puts [format "%16s: --- error ($msg)" $script]
38 foreach var
{pass fail skip tests
} {
39 incr total
($var) [$i eval "set testinfo(num$var)"]
45 puts [string repeat
= 73]
46 puts [format "%16s: Total %5d Passed %5d Skipped %5d Failed %5d" \
47 Totals
$total(tests
) $total(pass
) $total(skip
) $total(fail
)]