From aed37159d551144579fe5267bb3dd297cfe9444e Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Sun, 3 Jan 2021 13:09:30 +1000 Subject: 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 --- bootstrap.tcl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bootstrap.tcl') 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 -- cgit v1.1