diff options
author | Steve Bennett <steveb@workware.net.au> | 2017-09-17 19:34:02 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2017-09-21 16:31:00 +1000 |
commit | ab898002fa7b3e354703c6a4a84c34f9482cf9f4 (patch) | |
tree | 64279245c0a2b2fedb925f79a1dc261c100c44ec /tcltest.tcl | |
parent | ab299323709d7e974262b257bf75909aed9d8d97 (diff) | |
download | jimtcl-ab898002fa7b3e354703c6a4a84c34f9482cf9f4.zip jimtcl-ab898002fa7b3e354703c6a4a84c34f9482cf9f4.tar.gz jimtcl-ab898002fa7b3e354703c6a4a84c34f9482cf9f4.tar.bz2 |
tcltest: Support 'needs package xxx'
Makes it easy to skip all tests if the package isn't available
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tcltest.tcl')
-rw-r--r-- | tcltest.tcl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tcltest.tcl b/tcltest.tcl index b7e3983..5b0198a 100644 --- a/tcltest.tcl +++ b/tcltest.tcl @@ -44,6 +44,12 @@ proc needs {type what {packages {}}} { } skiptest " (command $what)" } + if {$type eq "package"} { + if {[catch {package require $what}]} { + skiptest " (package $what)" + } + return + } error "Unknown needs type: $type" } |