# This file contains a top-level script to run all of the tests
# for Tcl Blend or Jacl. Execute it by invoking "make test" where
# you from the build directory. You can also bring up a shell by
# typing "make shell" in the build directory and then you can run
# all the tests my by typing "cd .. ; cd tests ; source all".
#
# Copyright (c) 1997-1998 by Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: all,v 1.4 1999/08/31 23:56:29 redman Exp $

if {$tcl_platform(platform) == "java"} {
    # run the Jacl tests

    eval lappend tests [glob -nocomplain tcljava/*.test \
	jacl/*.test inprogress/*.test tcl/*.test]

} elseif {[info exists env(TCLBLEND_RUN_ALL_TESTS)]} {
    # run the Tcl Blend tests

    set tests [glob -nocomplain tcljava/*.test \
	inprogress/*.test tclblend/*.test tcl/*.test ]
} else {
    # run the Tcl Blend tests

    set tests [glob -nocomplain tcljava/*.test \
	tclblend/*.test ]
}

foreach i $tests {

    if {[string match l.*.test [file tail $i]]} {
	# This is an SCCS lock file;  ignore it.
	continue
    }

    puts stdout $i
    flush stdout

    if {[catch {source $i} msg]} {
	puts $msg
    }

}
