diff options
author | stanton <stanton@noemail.net> | 1999-04-16 01:51:06 (GMT) |
---|---|---|
committer | stanton <stanton@noemail.net> | 1999-04-16 01:51:06 (GMT) |
commit | 58364783d6f176ecb8520dade8d1cb1a346c0950 (patch) | |
tree | 31378e81bd58f8c726fc552d6b30cbf3ca07497b /tests/all.tcl | |
parent | 878ed3a2c9af6e583516ac48fd69ce3b349ac5f8 (diff) | |
download | tk-58364783d6f176ecb8520dade8d1cb1a346c0950.zip tk-58364783d6f176ecb8520dade8d1cb1a346c0950.tar.gz tk-58364783d6f176ecb8520dade8d1cb1a346c0950.tar.bz2 |
* Merged 8.1 branch into the main trunk
FossilOrigin-Name: 1120dc4257448ed1955333e682de48e2940cc741
Diffstat (limited to 'tests/all.tcl')
-rw-r--r-- | tests/all.tcl | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/tests/all.tcl b/tests/all.tcl new file mode 100644 index 0000000..fc2b89d --- /dev/null +++ b/tests/all.tcl @@ -0,0 +1,78 @@ +# all.tcl -- +# +# This file contains a top-level script to run all of the Tk +# tests. Execute it by invoking "source all.tcl" when running tktest +# in this directory. +# +# Copyright (c) 1998-1999 by Scriptics Corporation. +# All rights reserved. +# +# RCS: @(#) $Id: all.tcl,v 1.2 1999/04/16 01:51:33 stanton Exp $ + +if {[lsearch ::tcltest [namespace children]] == -1} { + source [file join [pwd] [file dirname [info script]] defs.tcl] +} +set ::tcltest::testSingleFile false + +puts stdout "Tk $tk_patchLevel tests running in interp: [info nameofexecutable]" +puts stdout "Tests running in working dir: $::tcltest::workingDir" +if {[llength $::tcltest::skip] > 0} { + puts stdout "Skipping tests that match: $::tcltest::skip" +} +if {[llength $::tcltest::match] > 0} { + puts stdout "Only running tests that match: $::tcltest::match" +} + +# Use command line specified glob pattern (specified by -file or -f) +# if one exists. Otherwise use *.test. If given, the file pattern +# should be specified relative to the dir containing this file. If no +# files are found to match the pattern, print an error message and exit. +set fileIndex [expr {[lsearch $argv "-file"] + 1}] +set fIndex [expr {[lsearch $argv "-f"] + 1}] +if {($fileIndex < 1) || ($fIndex > $fileIndex)} { + set fileIndex $fIndex +} +if {$fileIndex > 0} { + set globPattern [file join $::tcltest::testsDir [lindex $argv $fileIndex]] + puts stdout "Sourcing files that match: $globPattern" +} else { + set globPattern [file join $::tcltest::testsDir *.test] +} +set fileList [glob -nocomplain $globPattern] +if {[llength $fileList] < 1} { + puts "Error: no files found matching $globPattern" + exit +} +set timeCmd {clock format [clock seconds]} +puts stdout "Tests began at [eval $timeCmd]" + +# source each of the specified tests +foreach file [lsort $fileList] { + set tail [file tail $file] + if {[string match l.*.test $tail]} { + # This is an SCCS lockfile; ignore it + continue + } + puts stdout $tail + if {[catch {source $file} msg]} { + puts stdout $msg + } +} + +# cleanup +puts stdout "\nTests ended at [eval $timeCmd]" +::tcltest::cleanupTests 1 +return + + + + + + + + + + + + + |