aboutsummaryrefslogtreecommitdiff
path: root/bootstrap.tcl
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2021-01-03 13:09:30 +1000
committerSteve Bennett <steveb@workware.net.au>2021-01-03 13:09:30 +1000
commitaed37159d551144579fe5267bb3dd297cfe9444e (patch)
tree097cf937957391df7b2ed1b7563df1e829145e05 /bootstrap.tcl
parenta432a96ecae0fa93d76e602510719cef931916e2 (diff)
downloadjimtcl-aed37159d551144579fe5267bb3dd297cfe9444e.zip
jimtcl-aed37159d551144579fe5267bb3dd297cfe9444e.tar.gz
jimtcl-aed37159d551144579fe5267bb3dd297cfe9444e.tar.bz2
bootstrap jimsh: pass all tests
In order to test bootstrap jimsh, it is very helpful if it can pass all the unit tests. - Set tcl_platform(bootstrap) to 1 for bootstrap jimsh or 0 otherwise - Use getref to determine in we have references, not ref since we implement a poor-man's ref for bootstrap jimsh - bootstrap jimsh package doesn't return a "Can't load package" message if loading the package fails - exec tests using [open |command] need pipe - bootstrap jimsh can't set file times with [file mtime] Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'bootstrap.tcl')
-rw-r--r--bootstrap.tcl8
1 files changed, 4 insertions, 4 deletions
diff --git a/bootstrap.tcl b/bootstrap.tcl
index c93ec9f..9406c19 100644
--- a/bootstrap.tcl
+++ b/bootstrap.tcl
@@ -1,16 +1,16 @@
# Minimal support for package require
-# No error on failure since C extensions aren't handled
-proc package {cmd pkg args} {
+proc package {cmd args} {
if {$cmd eq "require"} {
foreach path $::auto_path {
+ lassign $args pkg
set pkgpath $path/$pkg.tcl
if {$path eq "."} {
set pkgpath $pkg.tcl
}
if {[file exists $pkgpath]} {
- uplevel #0 [list source $pkgpath]
- return
+ tailcall uplevel #0 [list source $pkgpath]
}
}
}
}
+set tcl_platform(bootstrap) 1