From f11320b6b0dd2681bef8470d4fcf7c3b7eb6cbbd Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 13 Sep 2018 20:31:45 +0000 Subject: Fix various test-cases, which started failing on Windows due to TIP #430 --- tests/env.test | 2 ++ tests/exec.test | 2 ++ tests/platform.test | 2 +- tests/thread.test | 7 +++++-- win/Makefile.in | 4 ++++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/env.test b/tests/env.test index 59d5391..79a353a 100644 --- a/tests/env.test +++ b/tests/env.test @@ -16,6 +16,8 @@ if {[lsearch [namespace children] ::tcltest] == -1} { namespace import -force ::tcltest::* } +loadTestedCommands +catch [list package require -exact Tcltest [info patchlevel]] package require tcltests # [exec] is required here to see the actual environment received by child diff --git a/tests/exec.test b/tests/exec.test index dfc44c4..4fd8b8d 100644 --- a/tests/exec.test +++ b/tests/exec.test @@ -17,6 +17,8 @@ package require tcltest 2 namespace import -force ::tcltest::* +loadTestedCommands +catch [list package require -exact Tcltest [info patchlevel]] package require tcltests # All tests require the "exec" command. diff --git a/tests/platform.test b/tests/platform.test index 5880fb9..53d534e 100644 --- a/tests/platform.test +++ b/tests/platform.test @@ -10,7 +10,6 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. package require tcltest 2 -package require tcltests namespace eval ::tcl::test::platform { namespace import ::tcltest::testConstraint @@ -23,6 +22,7 @@ namespace eval ::tcl::test::platform { ::tcltest::loadTestedCommands catch [list package require -exact Tcltest [info patchlevel]] +package require tcltests testConstraint testCPUID [llength [info commands testcpuid]] testConstraint testlongsize [llength [info commands testlongsize]] diff --git a/tests/thread.test b/tests/thread.test index eaaaa41..2524911 100644 --- a/tests/thread.test +++ b/tests/thread.test @@ -11,14 +11,17 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. +if {"::tcltest" ni [namespace children]} { + package require tcltest 2 + namespace import -force ::tcltest::* +} # when thread::release is used, -wait is passed in order allow the thread to # be fully finalized, which avoids valgrind "still reachable" reports. -package require tcltests - ::tcltest::loadTestedCommands catch [list package require -exact Tcltest [info patchlevel]] +package require tcltests # Some tests require the testthread command diff --git a/win/Makefile.in b/win/Makefile.in index 1d9c522..b5095e7 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -486,6 +486,8 @@ ${TCL_ZIP_FILE}: ${ZIP_INSTALL_OBJS} rm -rf ${TCL_VFS_ROOT} mkdir -p ${TCL_VFS_PATH} $(COPY) -a $(TOP_DIR)/library/* ${TCL_VFS_PATH} + $(COPY) ${DDE_DLL_FILE} ${TCL_VFS_PATH}/dde + $(COPY) ${REG_DLL_FILE} ${TCL_VFS_PATH}/reg cd ${TCL_VFS_ROOT} ; ${NATIVE_ZIP} ${ZIP_PROG_OPTIONS} ../${TCL_ZIP_FILE} ${ZIP_PROG_VFSSEARCH} $(TCLSH): $(TCLSH_OBJS) @LIBRARIES@ $(TCL_STUB_LIB_FILE) tclsh.$(RES) @@ -864,6 +866,7 @@ test-tcl: binaries $(TCLSH) $(CAT32) $(TEST_DLL_FILE) TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \ ./$(TCLSH) "$(ROOT_DIR_NATIVE)/tests/all.tcl" $(TESTFLAGS) \ -load "package ifneeded Tcltest ${VERSION}@TCL_PATCH_LEVEL@ [list load [file normalize ${TEST_DLL_FILE}] Tcltest]; \ + package ifneeded tcltests 0.1 \"[list source [file normalize $(ROOT_DIR_NATIVE)/tests/tcltests.tcl]];package provide tcltests 0.1\"; \ package ifneeded dde 1.4.0 [list load [file normalize ${DDE_DLL_FILE}] dde]; \ package ifneeded registry 1.3.2 [list load [file normalize ${REG_DLL_FILE}] registry]" | ./$(CAT32) @@ -871,6 +874,7 @@ test-tcl: binaries $(TCLSH) $(CAT32) $(TEST_DLL_FILE) runtest: binaries $(TCLSH) $(TEST_DLL_FILE) @TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \ ./$(TCLSH) $(TESTFLAGS) -load "package ifneeded Tcltest ${VERSION}@TCL_PATCH_LEVEL@ [list load [file normalize ${TEST_DLL_FILE}] Tcltest]; \ + package ifneeded tcltests 0.1 \"[list source [file normalize $(ROOT_DIR_NATIVE)/tests/tcltests.tcl]];package provide tcltests 0.1\"; \ package ifneeded dde 1.4.0 [list load [file normalize ${DDE_DLL_FILE}] dde]; \ package ifneeded registry 1.3.2 [list load [file normalize ${REG_DLL_FILE}] registry]" $(SCRIPT) -- cgit v0.12