Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -63,11 +63,11 @@ sed 's@ *@@g;s@..@0x&, @g' < nano.tcl.h.new.1 > nano.tcl.h.new.2 rm -f nano.tcl.h.new.1 mv nano.tcl.h.new.2 nano.tcl.h test: @EXTENSION_TARGET@ pkgIndex.tcl - @srcdir@/test/test.tcl . + @srcdir@/test/test.tcl --libpath . --libpath @TCLLIB_PATH@ ifeq (@ENABLE_COVERAGE@,true) coverage.dir: test rm -f nano-coverage.info lcov --capture --directory . --output-file nano-coverage.info Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -112,10 +112,19 @@ AC_CHECK_FUNC(getrandom,, [ AC_CHECK_FUNC(getentropy,, [ AC_CHECK_FUNC(CryptGenRandom) ]) ]) + +dnl Handle specifying where TCLLIB is, for testing +AC_SUBST(TCLLIB_PATH) +TCLLIB_PATH='/dev/null' +AC_ARG_WITH([tcllib-path], AS_HELP_STRING([--with-tcllib-path=], [Specify a path to Tcllib for the test suite]), [ + if test "$withval" != "no" -a "$withval" != "yes"; then + TCLLIB_PATH="${withval}" + fi +]) dnl Sync the RPATH if requested if test "$TCLEXT_BUILD" != 'static'; then DC_SYNC_RPATH([yes]) fi Index: test/test.tcl ================================================================== --- test/test.tcl +++ test/test.tcl @@ -1,8 +1,14 @@ #! /usr/bin/env tclsh -lappend auto_path [file normalize [lindex $argv 0]] +foreach {arg val} $argv { + switch -exact -- $arg { + "--libpath" { + lappend auto_path [file normalize $val] + } + } +} package require nano proc test_selftest {} { ::nano::internal::selfTest