summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2019-01-14 19:59:19 (GMT)
committersebres <sebres@users.sourceforge.net>2019-01-14 19:59:19 (GMT)
commit1b13dffa8c63561730b6a741f9563dbea9f4acc8 (patch)
treeff23fb66c324df581e4aaff627838ab08e5c4b7d
parent2916e34116707472c0c76c6f3e0bd83345d33f6b (diff)
parent4aca9276dfef3ce6d54718351c0a3f80896228ff (diff)
downloadtcl-1b13dffa8c63561730b6a741f9563dbea9f4acc8.zip
tcl-1b13dffa8c63561730b6a741f9563dbea9f4acc8.tar.gz
tcl-1b13dffa8c63561730b6a741f9563dbea9f4acc8.tar.bz2
merge 8.6, conflicts resolved in win/Makefile.in (fixed auto-path and load tcltests for ROOT_DIR/tests)
-rw-r--r--generic/tclExecute.c2
-rw-r--r--tests/pkgIndex.tcl5
-rw-r--r--tests/tcltests.tcl2
-rw-r--r--win/Makefile.in56
-rw-r--r--win/tclWinTest.c4
5 files changed, 52 insertions, 17 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 036f422..04c7ee2 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -4964,7 +4964,7 @@ TEBCresume(
/* Every range of an empty list is an empty list */
if (objc == 0) {
/* avoid return of not canonical list (e. g. spaces in string repr.) */
- if (!valuePtr->bytes || !valuePtr->bytes[0]) {
+ if (!valuePtr->bytes || !valuePtr->length) {
TRACE_APPEND(("\n"));
NEXT_INST_F(9, 0, 0);
}
diff --git a/tests/pkgIndex.tcl b/tests/pkgIndex.tcl
index 854b943..96542f9 100644
--- a/tests/pkgIndex.tcl
+++ b/tests/pkgIndex.tcl
@@ -1,6 +1,3 @@
#! /usr/bin/env tclsh
-package ifneeded tcltests 0.1 "
- source [list $dir/tcltests.tcl]
- package provide tcltests 0.1
-"
+package ifneeded tcltests 0.1 [list source $dir/tcltests.tcl] \ No newline at end of file
diff --git a/tests/tcltests.tcl b/tests/tcltests.tcl
index 74d1b40..c8759a8 100644
--- a/tests/tcltests.tcl
+++ b/tests/tcltests.tcl
@@ -9,3 +9,5 @@ testConstraint fileevent [llength [info commands fileevent]]
testConstraint thread [
expr {0 == [catch {package require Thread 2.7-}]}]
testConstraint notValgrind [expr {![testConstraint valgrind]}]
+
+package provide tcltests 0.1 \ No newline at end of file
diff --git a/win/Makefile.in b/win/Makefile.in
index 6c26a0e..aa54377 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -116,6 +116,7 @@ GENERIC_DIR_NATIVE = $(shell $(CYGPATH) '$(GENERIC_DIR)')
TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)')
WIN_DIR_NATIVE = $(shell $(CYGPATH) '$(WIN_DIR)')
ROOT_DIR_NATIVE = $(shell $(CYGPATH) '$(ROOT_DIR)')
+ROOT_DIR_WIN_NATIVE = $(shell cd '$(ROOT_DIR)' ; pwd -W || pwd -P)
ZLIB_DIR_NATIVE = $(shell $(CYGPATH) '$(ZLIB_DIR)')
#GENERIC_DIR_NATIVE = $(GENERIC_DIR)
#TOMMATH_DIR_NATIVE = $(TOMMATH_DIR)
@@ -150,7 +151,13 @@ DDE_LIB_FILE = @LIBPREFIX@tcldde$(DDEVER)${LIBSUFFIX}
REG_DLL_FILE = tclreg$(REGVER)${DLLSUFFIX}
REG_LIB_FILE = @LIBPREFIX@tclreg$(REGVER)${LIBSUFFIX}
TEST_DLL_FILE = tcltest$(VER)${DLLSUFFIX}
+TEST_EXE_FILE = tcltest${EXESUFFIX}
TEST_LIB_FILE = @LIBPREFIX@tcltest$(VER)${LIBSUFFIX}
+TEST_LOAD_PRMS = lappend ::auto_path {$(ROOT_DIR_WIN_NATIVE)/tests};\
+ package ifneeded dde 1.4.1 [list load [file normalize ${DDE_DLL_FILE}] dde];\
+ package ifneeded registry 1.3.3 [list load [file normalize ${REG_DLL_FILE}] registry]
+TEST_LOAD_FACILITIES = package ifneeded Tcltest ${VERSION}@TCL_PATCH_LEVEL@ [list load [file normalize ${TEST_DLL_FILE}] Tcltest];\
+ $(TEST_LOAD_PRMS)
ZLIB_DLL_FILE = zlib1.dll
SHARED_LIBRARIES = $(TCL_DLL_FILE) @ZLIB_DLL_FILE@
@@ -471,7 +478,34 @@ TCL_DOCS = "$(ROOT_DIR_NATIVE)"/doc/*.[13n]
all: binaries libraries doc packages
-tcltest: $(TCLSH) $(TEST_DLL_FILE)
+# Test-suite helper (can be used to test Tcl from build directory with all expected modules).
+# To start from windows shell use:
+# > tcltest.cmd -verbose bps -file fileName.test
+# or from mingw/msys shell:
+# $ ./tcltest -verbose bps -file fileName.test
+
+tcltest.cmd:
+ @echo 'Create tcltest.cmd helpers';
+ @(\
+ echo '@echo off'; \
+ echo 'rem set LANG=en_US'; \
+ echo 'set BDP=%~dp0'; \
+ echo 'set OWD=%CD%'; \
+ echo 'cd /d %TEMP%'; \
+ echo 'rem "%BDP%\$(TCLSH)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $(TESTFLAGS) -load "$(TEST_LOAD_FACILITIES)" %*'; \
+ echo '"%BDP%\$(TEST_EXE_FILE)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $(TESTFLAGS) -load "$(TEST_LOAD_PRMS)" %*'; \
+ echo 'cd /d %OWD%'; \
+ ) > tcltest.cmd;
+ @(\
+ echo '#!/bin/sh'; \
+ echo '#LANG=en_US'; \
+ echo 'BDP=$$(dirname $$(readlink -f %0))'; \
+ echo 'cd /tmp'; \
+ echo '#"$$BDP/$(TCLSH)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $(TESTFLAGS) -load "$(TEST_LOAD_FACILITIES)" "$$@"'; \
+ echo '"$$BDP/$(TEST_EXE_FILE)" "$(ROOT_DIR_WIN_NATIVE)/tests/all.tcl" $(TESTFLAGS) -load "$(TEST_LOAD_PRMS)" "$$@"'; \
+ ) > tcltest;
+
+tcltest: $(TCLSH) $(TEST_EXE_FILE) $(TEST_DLL_FILE) tcltest.cmd
binaries: $(TCL_STUB_LIB_FILE) @LIBRARIES@ winextensions ${TCL_ZIP_FILE} $(TCLSH)
@@ -540,6 +574,11 @@ ${TEST_DLL_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS}
@$(RM) ${TEST_DLL_FILE} ${TEST_LIB_FILE}
@MAKE_DLL@ ${TCLTEST_OBJS} $(TCL_STUB_LIB_FILE) $(SHLIB_LD_LIBS)
+${TEST_EXE_FILE}: ${TCL_STUB_LIB_FILE} ${TCLTEST_OBJS} tclTestMain.${OBJEXT}
+ @$(RM) ${TEST_EXE_FILE}
+ $(CC) $(CFLAGS) $(TCLTEST_OBJS) tclTestMain.$(OBJEXT) $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) $(LIBS) \
+ tclsh.$(RES) $(CC_EXENAME) $(LDFLAGS_CONSOLE)
+
# use pre-built zlib1.dll
${ZLIB_DLL_FILE}: ${TCL_STUB_LIB_FILE}
@if test "@ZLIB_LIBS@set" != "${ZLIB_DIR_NATIVE}/win32/zdll.libset" ; then \
@@ -557,6 +596,9 @@ ${ZLIB_DLL_FILE}: ${TCL_STUB_LIB_FILE}
# Special case object targets
+tclTestMain.${OBJEXT}: tclAppInit.c
+ $(CC) -c $(CC_SWITCHES) -DTCL_TEST -DBUILD_tcl $(EXTFLAGS) $(CC_OBJNAME) $(WIN_DIR)/tclAppInit.c
+
tclWinInit.${OBJEXT}: tclWinInit.c
$(CC) -c $(CC_SWITCHES) -DBUILD_tcl $(EXTFLAGS) @DEPARG@ $(CC_OBJNAME)
@@ -873,18 +915,12 @@ test: test-tcl test-packages
test-tcl: binaries $(TCLSH) $(CAT32) $(TEST_DLL_FILE)
TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \
$(WINE) ./$(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.1 [list load [file normalize ${DDE_DLL_FILE}] dde]; \
- package ifneeded registry 1.3.3 [list load [file normalize ${REG_DLL_FILE}] registry]" | $(WINE) ./$(CAT32)
+ -load "$(TEST_LOAD_FACILITIES)" | $(WINE) ./$(CAT32)
# Useful target to launch a built tclsh with the proper path,...
runtest: binaries $(TCLSH) $(TEST_DLL_FILE)
@TCL_LIBRARY="$(LIBRARY_DIR)"; export TCL_LIBRARY; \
- $(WINE) ./$(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.1 [list load [file normalize ${DDE_DLL_FILE}] dde]; \
- package ifneeded registry 1.3.3 [list load [file normalize ${REG_DLL_FILE}] registry]" $(SCRIPT)
+ $(WINE) ./$(TCLSH) $(TESTFLAGS) -load "$(TEST_LOAD_FACILITIES)" $(SCRIPT)
# This target can be used to run tclsh from the build directory via
# `make shell SCRIPT=foo.tcl`
@@ -908,7 +944,7 @@ cleanhelp:
clean: cleanhelp clean-packages
$(RM) *.lib *.a *.exp *.dll *.$(RES) *.${OBJEXT} *~ \#* TAGS a.out
- $(RM) $(TCLSH) $(CAT32)
+ $(RM) $(TCLSH) $(CAT32) $(TEST_EXE_FILE) $(TEST_DLL_FILE) tcltest.cmd tcltest
$(RM) *.pch *.ilk *.pdb
$(RM) minizip${HOST_EXEEXT} *.${HOST_OBJEXT}
$(RM) *.zip
diff --git a/win/tclWinTest.c b/win/tclWinTest.c
index 80e3f10..40be3d5 100644
--- a/win/tclWinTest.c
+++ b/win/tclWinTest.c
@@ -399,11 +399,11 @@ TestplatformChmod(
{
static const SECURITY_INFORMATION infoBits = OWNER_SECURITY_INFORMATION
| GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
- /* don't deny DELETE mask (reset writable only, allow test-cases cleanup) */
+ /* don't reset change permissions mask (WRITE_DAC, allow test-cases restore it to cleanup) */
static const DWORD readOnlyMask = FILE_DELETE_CHILD | FILE_ADD_FILE
| FILE_ADD_SUBDIRECTORY | FILE_WRITE_EA | FILE_APPEND_DATA
| FILE_WRITE_DATA
- /* | DELETE */;
+ | DELETE;
/*
* References to security functions (only available on NT and later).