diff options
author | hershey <hershey> | 1999-03-11 18:49:22 (GMT) |
---|---|---|
committer | hershey <hershey> | 1999-03-11 18:49:22 (GMT) |
commit | 07d6012fb42480a22f42f53b9d73eb838d5c67d7 (patch) | |
tree | 0462404b0b65394e3ef76acdc52cc18966fb9789 /tests/all.tcl | |
parent | 4a327a6afdf45b23c8606d5f3d5a51b2b7876384 (diff) | |
download | tcl-07d6012fb42480a22f42f53b9d73eb838d5c67d7.zip tcl-07d6012fb42480a22f42f53b9d73eb838d5c67d7.tar.gz tcl-07d6012fb42480a22f42f53b9d73eb838d5c67d7.tar.bz2 |
Updated the testsuite to use "test" namespace and commandline args
to control verbose level and which tests get run. Tests now work from
any working dir.
Diffstat (limited to 'tests/all.tcl')
-rw-r--r-- | tests/all.tcl | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/all.tcl b/tests/all.tcl new file mode 100644 index 0000000..2db3b75 --- /dev/null +++ b/tests/all.tcl @@ -0,0 +1,61 @@ +# all.tcl -- +# +# This file contains a top-level script to run all of the Tcl +# tests. Execute it by invoking "source all.test" when running tcltest +# in this directory. +# +# Copyright (c) 1998-1999 by Scriptics Corporation. +# All rights reserved. +# +# RCS: @(#) $Id: all.tcl,v 1.1.2.1 1999/03/11 18:49:22 hershey Exp $ + +if {[lsearch ::test [namespace children]] == -1} { + source [file join [pwd] [file dirname [info script]] defs.tcl] +} +puts stdout "Tcl 8.1 tests running in interp: [info nameofexecutable]" +puts stdout "Tests running in working dir: $::test::tmpDir" +if {[llength $::test::skippingTests] > 0} { + puts stdout "Skipping tests that match: $::test::skippingTests" +} +if {[llength $::test::matchingTests] > 0} { + puts stdout "Only running tests that match: $::test::matchingTests" +} + +# Use command line specified glob pattern (specified by -file or -f) +# if one exists. Otherwise use *.test (or *.tes on win32s). 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 $::test::testsDir [lindex $argv $fileIndex]] + puts stdout "Sourcing files that match: $globPattern" +} elseif {$tcl_platform(os) == "Win32s"} { + set [file join $::test::testsDir globPattern *.tes] +} else { + set [file join $::test::testsDir globPattern *.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]" +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 + } +} +puts stdout "\nTests ended at [eval $timeCmd]" |