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 # In case interp is a module
9 catch {package require
interp}
11 if {[info commands
interp] eq
""} {
13 foreach script
[lsort [glob *.test
]] {
15 exec [info nameofexecutable
] $script >@stdout
2>@stderr
18 puts "Failed: $script"
23 array set total
{pass
0 fail
0 skip
0 tests
0}
24 foreach script
[lsort [glob *.test
]] {
29 foreach var
{argv0 auto_path
} {
30 $i eval [list set $var [set ::$var]]
34 catch -exit {$i eval source $script} msg opts
35 if {[info returncode
$opts(-code)] eq
"error"} {
36 puts [format "%16s: --- error ($msg)" $script]
41 foreach var
{pass fail skip tests
} {
42 incr total
($var) [$i eval "set testinfo(num$var)"]
48 puts [string repeat
= 73]
49 puts [format "%16s: Total %5d Passed %5d Skipped %5d Failed %5d" \
50 Totals
$total(tests
) $total(pass
) $total(skip
) $total(fail
)]