# This file contains a top-level script to run all of the Tcl
# tests.  Execute it by invoking "source all" when running tclTest
# in this directory.
#

# If the srcdir variable exists, tests are looked for in that
# directory.  Otherwise they are looked for in ".".

if {! [info exists srcdir]} then {
    set srcdir .
}

# Always explicitly load `defs', so tests don't have to.  This avoids
# the need for each .test file to know about $srcdir.

source $srcdir/defs

if {$tcl_platform(os) == "Win32s"} {
    set files [glob $srcdir/*.tes]
} else {
    set files [glob $srcdir/*.test]
}

foreach i [lsort $files] {
    if [string match l.*.test $i] {
	# This is an SCCS lock file;  ignore it.
	continue
    }
    puts stdout [file tail $i]
    if [catch {source $i} msg] {
	puts $msg
    }	
}
puts "Tests all done"
