summaryrefslogtreecommitdiffstats
path: root/tests/all.tcl
diff options
context:
space:
mode:
authorjenn <jenn>2000-09-20 23:09:45 (GMT)
committerjenn <jenn>2000-09-20 23:09:45 (GMT)
commitb5d5b0feb62c4a8be32c341478bec58d643e7e0a (patch)
tree71911b9bd26338d75be6d56cb37fe77a14238f4f /tests/all.tcl
parentac36b4dd74f9359f07bfdb431c932d702064652f (diff)
downloadtcl-b5d5b0feb62c4a8be32c341478bec58d643e7e0a.zip
tcl-b5d5b0feb62c4a8be32c341478bec58d643e7e0a.tar.gz
tcl-b5d5b0feb62c4a8be32c341478bec58d643e7e0a.tar.bz2
* library/tcltest1.0/pkgIndex.tcl: Updated to load tcltest 2.0.
* library/tcltest1.0/tcltest2.tcl: New version of tcltest. Cleanup of command line parsing: allows users to specify command line arguments through an environment variable named TCLTEST_OPTIONS [RFE: 3748], does not respond to incorrect arguments, and forces usage of entire flag name when using command line arguments. Defines accessor procs for all tcltest variables. Allows users to use 'return' in test scripts. Allow users to specify whether test files should be sourced or run in a separate process. 'all.tcl' code moved to tcltest package. 'test' proc modified to use attribute-value pairs. Allow users to specify what return codes, output, and errors can be compared and whether these values should be compared using regexp, glob, or exact matching. makeDirectory & removeDirectory now operate with respect to temporaryDirectory [Bug: 6001]. Test results from tests run in slave interpreters are now included in test totals [Bug: 1493]. Test files that return error values are now reported. * tests/all.tcl: Added code to check for the tcltest version loaded; modified to figure out which tests to run based on the tcltest version loaded. * tests/tcltest.test: Modified to explicitly load version 1.0 of tcltest. * tests/tcltest2.test: New test suite for tcltest; includes all of the old tests plus new ones reflecting changes made for version 2.0. * tests/cmdAH.test: Added singleTestInterp constraint to cmdAH-31.2; this test does not run if tests aren't sourced into a single interpreter. * tests/socket.test: Fixed two tests that were referencing variables outside of scope. * tools/tcl.wse.in: Added code to install tcltest2.tcl. * doc/tcltest2.n: New documentation for tcltest version 2.0. Removes documentation for tcltest namespace variables. Adds documentation for new tcltest procs. * unix/mkLinks: Added code to link to tcltest2.n. * generic/tcl.h: Added comment to modify tcltest2.tcl as well as tcltest.tcl for version changes.
Diffstat (limited to 'tests/all.tcl')
-rw-r--r--tests/all.tcl83
1 files changed, 44 insertions, 39 deletions
diff --git a/tests/all.tcl b/tests/all.tcl
index df5cb3d..7c7ea53 100644
--- a/tests/all.tcl
+++ b/tests/all.tcl
@@ -5,51 +5,56 @@
# in this directory.
#
# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 2000 by Ajuba Solutions
# All rights reserved.
#
-# RCS: @(#) $Id: all.tcl,v 1.10 2000/04/10 17:18:56 ericm Exp $
-
-if {[lsearch [namespace children] ::tcltest] == -1} {
- package require tcltest
- namespace import -force ::tcltest::*
-}
-
-set ::tcltest::testSingleFile false
-set ::tcltest::testsDirectory [file dir [info script]]
-
-# We need to ensure that the testsDirectory is absolute
-::tcltest::normalizePath ::tcltest::testsDirectory
-
-puts stdout "Tcl $tcl_patchLevel tests running in interp: [info nameofexecutable]"
-puts stdout "Tests running in working dir: $::tcltest::testsDirectory"
-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"
-}
+# RCS: @(#) $Id: all.tcl,v 1.11 2000/09/20 23:09:54 jenn Exp $
+
+set tcltestVersion [package require tcltest]
+namespace import -force tcltest::*
+
+if {[package vcompare $tcltestVersion 1.0]} {
+ tcltest::testsDirectory [file dir [info script]]
+ tcltest::runAllTests
+} else {
+ set ::tcltest::testSingleFile false
+ set ::tcltest::testsDirectory [file dir [info script]]
+
+ # We need to ensure that the testsDirectory is absolute
+ ::tcltest::normalizePath ::tcltest::testsDirectory
+
+ puts stdout "Tcl $tcl_patchLevel tests running in interp: [info nameofexecutabl
+ e]"
+ puts stdout "Tests running in working dir: $::tcltest::testsDirectory"
+ 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"
+ }
-if {[llength $::tcltest::skipFiles] > 0} {
- puts stdout "Skipping test files that match: $::tcltest::skipFiles"
-}
-if {[llength $::tcltest::matchFiles] > 0} {
- puts stdout "Only sourcing test files that match: $::tcltest::matchFiles"
-}
+ if {[llength $::tcltest::skipFiles] > 0} {
+ puts stdout "Skipping test files that match: $::tcltest::skipFiles"
+ }
+ 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]"
+ set timeCmd {clock format [clock seconds]}
+ puts stdout "Tests began at [eval $timeCmd]"
-# source each of the specified tests
-foreach file [lsort [::tcltest::getMatchingFiles]] {
- set tail [file tail $file]
- puts stdout $tail
- if {[catch {source $file} msg]} {
- puts stdout $msg
+ # source each of the specified tests
+ foreach file [lsort [::tcltest::getMatchingFiles]] {
+ set tail [file tail $file]
+ puts stdout $tail
+ if {[catch {source $file} msg]} {
+ puts stdout $msg
+ }
}
+
+ # cleanup
+ puts stdout "\nTests ended at [eval $timeCmd]"
+ ::tcltest::cleanupTests 1
}
-# cleanup
-puts stdout "\nTests ended at [eval $timeCmd]"
-::tcltest::cleanupTests 1
return
-