1# all.tcl --
2#
3# This file contains a top-level script to run all of the Tcl
4# tests.  Execute it by invoking "source all.test" when running tcltest
5# in this directory.
6#
7# Copyright (c) 1998-2000 by Scriptics Corporation.
8# All rights reserved.
9#
10# RCS: @(#) $Id: all.tcl,v 1.1 2002/08/23 18:04:40 andreas_kupries Exp $
11
12if {[lsearch [namespace children] ::tcltest] == -1} {
13    package require tcltest
14    namespace import ::tcltest::*
15}
16
17set ::tcltest::testSingleFile false
18set ::tcltest::testsDirectory [file dir [info script]]
19
20# We need to ensure that the testsDirectory is absolute
21::tcltest::normalizePath ::tcltest::testsDirectory
22
23set chan $::tcltest::outputChannel
24
25puts $chan "Tests running in interp:       [info nameofexecutable]"
26puts $chan "Tests running with pwd:        [pwd]"
27puts $chan "Tests running in working dir:  $::tcltest::testsDirectory"
28if {[llength $::tcltest::skip] > 0} {
29    puts $chan "Skipping tests that match:            $::tcltest::skip"
30}
31if {[llength $::tcltest::match] > 0} {
32    puts $chan "Only running tests that match:        $::tcltest::match"
33}
34
35if {[llength $::tcltest::skipFiles] > 0} {
36    puts $chan "Skipping test files that match:       $::tcltest::skipFiles"
37}
38if {[llength $::tcltest::matchFiles] > 0} {
39    puts $chan "Only sourcing test files that match:  $::tcltest::matchFiles"
40}
41
42set timeCmd {clock format [clock seconds]}
43puts $chan "Tests began at [eval $timeCmd]"
44
45# source each of the specified tests
46foreach file [lsort [::tcltest::getMatchingFiles]] {
47    set tail [file tail $file]
48    puts $chan $tail
49    if {[catch {source $file} msg]} {
50	puts $chan $msg
51    }
52}
53
54# cleanup
55puts $chan "\nTests ended at [eval $timeCmd]"
56::tcltest::cleanupTests 1
57return
58
59