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
]] {
27 if {$script eq
"signal.test"} {
28 # special case, can't run this in a child interpeter
32 foreach var
{pass fail skip tests
} {
33 incr total
($var) $testinfo(num
$var)
38 foreach var
{argv0 auto_path
} {
39 $i eval [list set $var [set ::$var]]
43 catch -exit {$i eval source $script} msg opts
44 if {[info returncode
$opts(-code)] eq
"error"} {
45 puts [format "%16s: --- error ($msg)" $script]
50 foreach var
{pass fail skip tests
} {
51 incr total
($var) [$i eval "set testinfo(num$var)"]
58 puts [string repeat
= 73]
59 puts [format "%16s: Total %5d Passed %5d Skipped %5d Failed %5d" \
60 Totals
$total(tests
) $total(pass
) $total(skip
) $total(fail
)]