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
7 # Copyright (c) 1998-2000 by Scriptics Corporation.
10 # RCS: @(#) $Id: all.tcl,v 1.4 2004/07/04 22:04:20 patthoyts Exp $
12 if {[lsearch [namespace children] ::tcltest] == -1} {
13 package require tcltest
14 namespace import ::tcltest::*
17 set ::tcltest::testSingleFile false
18 set ::tcltest::testsDirectory [file dir [info script]]
20 # We need to ensure that the testsDirectory is absolute
21 if {[catch {::tcltest::normalizePath ::tcltest::testsDirectory}]} {
22 # The version of tcltest we have here does not support
23 # 'normalizePath', so we have to do this on our own.
26 catch {cd $::tcltest::testsDirectory}
27 set ::tcltest::testsDirectory [pwd]
31 set chan $::tcltest::outputChannel
33 puts $chan "Tests running in interp: [info nameofexecutable]"
34 puts $chan "Tests running with pwd: [pwd]"
35 puts $chan "Tests running in working dir: $::tcltest::testsDirectory"
36 if {[llength $::tcltest::skip] > 0} {
37 puts $chan "Skipping tests that match: $::tcltest::skip"
39 if {[llength $::tcltest::match] > 0} {
40 puts $chan "Only running tests that match: $::tcltest::match"
43 if {[llength $::tcltest::skipFiles] > 0} {
44 puts $chan "Skipping test files that match: $::tcltest::skipFiles"
46 if {[llength $::tcltest::matchFiles] > 0} {
47 puts $chan "Only sourcing test files that match: $::tcltest::matchFiles"
50 set timeCmd {clock format [clock seconds]}
51 puts $chan "Tests began at [eval $timeCmd]"
53 # source each of the specified tests
54 foreach file [lsort [::tcltest::getMatchingFiles]] {
55 set tail [file tail $file]
57 if {[catch {source $file} msg]} {
63 puts $chan "\nTests ended at [eval $timeCmd]"
64 ::tcltest::cleanupTests 1