summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjenn <jenn>1999-06-29 20:14:10 (GMT)
committerjenn <jenn>1999-06-29 20:14:10 (GMT)
commitc99437b6b643f14bb0cad6e38ecf813f45a41e71 (patch)
treedb7048bf1d37678abffa3e906a7ea4ce4463b05c /tests
parent3c38d311e45c88777c457a79bf487bed17e43ab4 (diff)
downloadtcl-c99437b6b643f14bb0cad6e38ecf813f45a41e71.zip
tcl-c99437b6b643f14bb0cad6e38ecf813f45a41e71.tar.gz
tcl-c99437b6b643f14bb0cad6e38ecf813f45a41e71.tar.bz2
Added flags -limitconstraints, -preservecore, -help, -file, -notfile, -relateddir,
and -asidefromdir to tcltest.tcl. Also added exported proc ::tcltest::getMatchingTestFiles to tcltest.tcl. Modified documentation to match and all.tcl to use the new functionality instead of implementing -file itself. Changed some test names in winPipe.test to remove duplicates.
Diffstat (limited to 'tests')
-rw-r--r--tests/all.tcl46
-rw-r--r--tests/winPipe.test18
2 files changed, 18 insertions, 46 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
-
-
-
-
-
-
-
-
-
-
diff --git a/tests/winPipe.test b/tests/winPipe.test
index d9db002..b2c3c8a 100644
--- a/tests/winPipe.test
+++ b/tests/winPipe.test
@@ -12,7 +12,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: winPipe.test,v 1.9 1999/06/26 20:55:20 rjohnson Exp $
+# RCS: @(#) $Id: winPipe.test,v 1.10 1999/06/29 20:14:17 jenn Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -306,7 +306,7 @@ catch {set env_temp $env(TEMP)}
set env(TMP) c:/
set env(TEMP) c:/
-test winpipe-4.1 {TclpCreateTempFile: cleanup temp files} {pcOnly stdio} {
+test winpipe-5.1 {TclpCreateTempFile: cleanup temp files} {pcOnly stdio} {
set x {}
set existing [glob -nocomplain c:/tcl*.tmp]
exec $::tcltest::tcltest < nothing
@@ -317,7 +317,7 @@ test winpipe-4.1 {TclpCreateTempFile: cleanup temp files} {pcOnly stdio} {
}
set x
} {}
-test winpipe-4.2 {TclpCreateTempFile: TMP and TEMP not defined} {pcOnly stdio} {
+test winpipe-5.2 {TclpCreateTempFile: TMP and TEMP not defined} {pcOnly stdio} {
set tmp $env(TMP)
set temp $env(TEMP)
unset env(TMP)
@@ -327,7 +327,7 @@ test winpipe-4.2 {TclpCreateTempFile: TMP and TEMP not defined} {pcOnly stdio} {
set env(TEMP) $temp
set x {}
} {}
-test winpipe-4.3 {TclpCreateTempFile: TMP specifies non-existent directory} \
+test winpipe-5.3 {TclpCreateTempFile: TMP specifies non-existent directory} \
{pcOnly stdio} {
set tmp $env(TMP)
set env(TMP) snarky
@@ -335,7 +335,7 @@ test winpipe-4.3 {TclpCreateTempFile: TMP specifies non-existent directory} \
set env(TMP) $tmp
set x {}
} {}
-test winpipe-4.4 {TclpCreateTempFile: TEMP specifies non-existent directory} \
+test winpipe-5.4 {TclpCreateTempFile: TEMP specifies non-existent directory} \
{pcOnly stdio} {
set tmp $env(TMP)
set temp $env(TEMP)
@@ -347,7 +347,7 @@ test winpipe-4.4 {TclpCreateTempFile: TEMP specifies non-existent directory} \
set x {}
} {}
-test winpipe-5.1 {PipeSetupProc & PipeCheckProc: read threads} \
+test winpipe-6.1 {PipeSetupProc & PipeCheckProc: read threads} \
{pcOnly stdio cat32} {
set f [open "|$cat32" r+]
fconfigure $f -blocking 0
@@ -367,7 +367,7 @@ test winpipe-5.1 {PipeSetupProc & PipeCheckProc: read threads} \
lappend x [catch {close $f} msg] $msg
} {writable timeout readable {foobar
} timeout 1 stderr32}
-test winpipe-5.2 {PipeSetupProc & PipeCheckProc: write threads} \
+test winpipe-6.2 {PipeSetupProc & PipeCheckProc: write threads} \
{pcOnly stdio cat32} {
set f [open "|$cat32" r+]
fconfigure $f -blocking 0
@@ -385,10 +385,10 @@ makeFile {
puts "[list $argv0 $argv]"
} echoArgs.tcl
-test winpipe-4.1 {BuildCommandLine: null arguments} {pcOnly stdio} {
+test winpipe-7.1 {BuildCommandLine: null arguments} {pcOnly stdio} {
exec $::tcltest::tcltest echoArgs.tcl foo "" bar
} {echoArgs.tcl {foo {} bar}}
-test winpipe-4.1 {BuildCommandLine: null arguments} {pcOnly stdio} {
+test winpipe-7.2 {BuildCommandLine: null arguments} {pcOnly stdio} {
exec $::tcltest::tcltest echoArgs.tcl foo \" bar
} {echoArgs.tcl {foo {"} bar}}