Fixes for componentized Pagedform
[tcl-tlc.git] / tests / all.tcl
blobe81d5a3a2708cd7826fc1568e9d65406c20992a1
1 # all.tcl --
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.
7 # Copyright (c) 1998-2000 by Scriptics Corporation.
8 # All rights reserved.
9 #
10 # RCS: @(#) $Id: all.tcl,v 1.4 2004/07/04 22:04:20 patthoyts Exp $
12 package require TLC-base
13 if {[file exists [file join tests loglevels_class]]} {
14 tlc::Baselog::load_classmap [file join tests loglevels_class]
16 if {[file exists [file join tests loglevels_func]]} {
17 tlc::Baselog::load_hotfuncs [file join tests loglevels_func]
20 if {[lsearch [namespace children] ::tcltest] == -1} {
21 package require tcltest
22 namespace import ::tcltest::*
25 set ::tcltest::testSingleFile false
26 set ::tcltest::testsDirectory [file dir [info script]]
28 # We need to ensure that the testsDirectory is absolute
29 if {[catch {::tcltest::normalizePath ::tcltest::testsDirectory}]} {
30 # The version of tcltest we have here does not support
31 # 'normalizePath', so we have to do this on our own.
33 set oldpwd [pwd]
34 catch {cd $::tcltest::testsDirectory}
35 set ::tcltest::testsDirectory [pwd]
36 cd $oldpwd
39 set chan $::tcltest::outputChannel
41 puts $chan "Tests running in interp: [info nameofexecutable]"
42 puts $chan "Tests running with pwd: [pwd]"
43 puts $chan "Tests running in working dir: $::tcltest::testsDirectory"
44 if {[llength $::tcltest::skip] > 0} {
45 puts $chan "Skipping tests that match: $::tcltest::skip"
47 if {[llength $::tcltest::match] > 0} {
48 puts $chan "Only running tests that match: $::tcltest::match"
51 if {[llength $::tcltest::skipFiles] > 0} {
52 puts $chan "Skipping test files that match: $::tcltest::skipFiles"
54 if {[llength $::tcltest::matchFiles] > 0} {
55 puts $chan "Only sourcing test files that match: $::tcltest::matchFiles"
58 set timeCmd {clock format [clock seconds]}
59 puts $chan "Tests began at [eval $timeCmd]"
61 # source each of the specified tests
62 foreach file [lsort [::tcltest::getMatchingFiles]] {
63 set tail [file tail $file]
64 puts $chan $tail
65 if {[catch {source $file} msg]} {
66 puts $chan $msg
70 # cleanup
71 puts $chan "\nTests ended at [eval $timeCmd]"
72 ::tcltest::cleanupTests 1
73 return