diff options
author | Steve Bennett <steveb@workware.net.au> | 2015-04-06 10:01:17 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2015-04-06 10:13:49 +1000 |
commit | af59339f008ae4eff13b0fea0eeff21a9d1e8b6c (patch) | |
tree | fe1c8de42c1f5092cf4d521f9f5e09860b6e26df /tcltest.tcl | |
parent | 85358e479e5bbf295a5aaf743f3c29a5e1a4fd1c (diff) | |
download | jimtcl-af59339f008ae4eff13b0fea0eeff21a9d1e8b6c.zip jimtcl-af59339f008ae4eff13b0fea0eeff21a9d1e8b6c.tar.gz jimtcl-af59339f008ae4eff13b0fea0eeff21a9d1e8b6c.tar.bz2 |
Avoid error in tcltest.tcl if $::argv0 is unset
Can happen if running interactively or via -e
Reported-by: Stuart Cassoff <stwo@bell.net>
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tcltest.tcl')
-rw-r--r-- | tcltest.tcl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tcltest.tcl b/tcltest.tcl index 408d803..d338b2a 100644 --- a/tcltest.tcl +++ b/tcltest.tcl @@ -9,9 +9,6 @@ set testinfo(numskip) 0 set testinfo(numtests) 0 set testinfo(failed) {} -set testdir [file dirname $::argv0] -set bindir [file dirname [info nameofexecutable]] - if {[lsearch $argv "-verbose"] >= 0 || [info exists env(testverbose)]} { incr testinfo(verbose) } @@ -71,7 +68,13 @@ if {[catch {info version}]} { return } -lappend auto_path $testdir $bindir [file dirname [pwd]] +# Add some search paths for packages +if {[exists argv0]} { + # The directory containing the original script + lappend auto_path [file dirname $argv0] +} +# The directory containing the jimsh executable +lappend auto_path [file dirname [info nameofexecutable]] # For Jim, this is reasonable compatible tcltest proc makeFile {contents name {dir {}}} { |