summaryrefslogtreecommitdiffstats
path: root/tests/all.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/all.tcl')
-rw-r--r--tests/all.tcl46
1 files changed, 9 insertions, 37 deletions
diff --git a/tests/all.tcl b/tests/all.tcl
index f158c93..b4d132d 100644
--- a/tests/all.tcl
+++ b/tests/all.tcl
@@ -7,18 +7,18 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: all.tcl,v 1.6 1999/06/26 21:09:15 rjohnson Exp $
+# RCS: @(#) $Id: all.tcl,v 1.7 1999/06/29 20:14:17 jenn Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
namespace import ::tcltest::*
}
-info commands
+
set ::tcltest::testSingleFile false
set ::tcltest::testsDirectory [file dir [info script]]
puts stdout "Tcl $tcl_patchLevel tests running in interp: [info nameofexecutable]"
-puts stdout "Tests running in working dir: $::tcltest::workingDirectory"
+puts stdout "Tests running in working dir: $::tcltest::testsDirectory"
if {[llength $::tcltest::skip] > 0} {
puts stdout "Skipping tests that match: $::tcltest::skip"
}
@@ -26,37 +26,19 @@ 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 {[llength $::tcltest::skipFiles] > 0} {
+ puts stdout "Skipping test files that match: $::tcltest::skipFiles"
}
-if {$fileIndex > 0} {
- set globPattern [file join $::tcltest::testsDirectory [lindex $argv $fileIndex]]
- puts stdout "Sourcing files that match: $globPattern"
-} else {
- set globPattern [file join $::tcltest::testsDirectory *.test]
-}
-set fileList [glob -nocomplain $globPattern]
-if {[llength $fileList] < 1} {
- puts "Error: no files found matching $globPattern"
- exit
+if {[llength $::tcltest::matchFiles] > 0} {
+ puts stdout "Only sourcing test files that match: $::tcltest::matchFiles"
}
+
set timeCmd {clock format [clock seconds]}
puts stdout "Tests began at [eval $timeCmd]"
# source each of the specified tests
-foreach file [lsort $fileList] {
+foreach file [lsort [::tcltest::getMatchingFiles]] {
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
@@ -68,13 +50,3 @@ puts stdout "\nTests ended at [eval $timeCmd]"
::tcltest::cleanupTests 1
return
-
-
-
-
-
-
-
-
-
-