# This file contains a top-level script to run all of the tests
# for Tcl Blend or Jacl. Execute it by invoking "source all" when
# running the tcl.lang.Shell or tclTest in this directory.
#
# 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.
#
# SCCS: @(#) all 1.27 98/02/10 17:04:46

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

    # These are currently the tests that Jacl can pass comfortably.
    # (ToDo) Add others!

    set fileList {append assocd case concat error eval expr 
	fileName for format get 
        if incr info join lindex linsert list llength lrange
	lreplace lsort parse parseOld pkg proc rename scan set split
	string subst trace unknown uplevel upvar while
    }

    foreach file $fileList {
	lappend tests ${file}.test
    }

    # (ToD0) Can't use glob java/*.test because it's broken on Windows.
    #

    cd java
    foreach file [lsort [glob -nocomplain *.test]] {
	lappend tests java/$file
    }
    cd ..

    cd common
    foreach file [lsort [glob -nocomplain *.test]] {
	lappend tests common/$file
    }
    cd ..

} else {
    # run the Tcl Blend tests

    set tests [glob -nocomplain common/*.test native/*.test]
}

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