]> git.sven.stormbind.net Git - sven/mysqltcl.git/blob - tests/all.tcl
Imported Upstream version 3.05
[sven/mysqltcl.git] / tests / all.tcl
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.4 2004/07/04 22:04:20 patthoyts Exp $
11
12 if {[lsearch [namespace children] ::tcltest] == -1} {
13     package require tcltest
14     namespace import ::tcltest::*
15 }
16
17 set ::tcltest::testSingleFile false
18 set ::tcltest::testsDirectory [file dir [info script]]
19
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.
24
25     set oldpwd [pwd]
26     catch {cd $::tcltest::testsDirectory}
27     set ::tcltest::testsDirectory [pwd]
28     cd $oldpwd
29 }
30
31 set chan $::tcltest::outputChannel
32
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"
38 }
39 if {[llength $::tcltest::match] > 0} {
40     puts $chan "Only running tests that match:        $::tcltest::match"
41 }
42
43 if {[llength $::tcltest::skipFiles] > 0} {
44     puts $chan "Skipping test files that match:       $::tcltest::skipFiles"
45 }
46 if {[llength $::tcltest::matchFiles] > 0} {
47     puts $chan "Only sourcing test files that match:  $::tcltest::matchFiles"
48 }
49
50 set timeCmd {clock format [clock seconds]}
51 puts $chan "Tests began at [eval $timeCmd]"
52
53 # source each of the specified tests
54 foreach file [lsort [::tcltest::getMatchingFiles]] {
55     set tail [file tail $file]
56     puts $chan $tail
57     if {[catch {source $file} msg]} {
58         puts $chan $msg
59     }
60 }
61
62 # cleanup
63 puts $chan "\nTests ended at [eval $timeCmd]"
64 ::tcltest::cleanupTests 1
65 return
66