summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-07-30 14:06:17 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-07-30 14:06:17 (GMT)
commitb06638a31cb3fb6d6671424bb6a96145d3c214bc (patch)
tree4f8bc37cfb822c78861919d9fa4611335f91a3b9
parentf9cd2ed03e8854ac2ce1e7c4c4af3a113428a7f3 (diff)
downloadtcl-b06638a31cb3fb6d6671424bb6a96145d3c214bc.zip
tcl-b06638a31cb3fb6d6671424bb6a96145d3c214bc.tar.gz
tcl-b06638a31cb3fb6d6671424bb6a96145d3c214bc.tar.bz2
eliminate the "testfinexit" command. We have the TCL_FINALIZE_ON_EXIT environment variable now, which makes "exit" do the same thing.
-rw-r--r--generic/tclTest.c57
-rw-r--r--tests/encoding.test7
-rw-r--r--win/Makefile.in6
3 files changed, 6 insertions, 64 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 680e360..b4192b2 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -313,11 +313,6 @@ static int TestexitmainloopCmd(ClientData dummy,
Tcl_Interp *interp, int argc, const char **argv);
static int TestpanicCmd(ClientData dummy,
Tcl_Interp *interp, int argc, const char **argv);
-#ifndef _WIN32
-static int TestfinexitObjCmd(ClientData dummy,
- Tcl_Interp *interp, int objc,
- Tcl_Obj *const objv[]);
-#endif /* _WIN32 */
static int TestparseargsCmd(ClientData dummy, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
static int TestparserObjCmd(ClientData dummy,
@@ -640,9 +635,6 @@ Tcltest_Init(
Tcl_CreateObjCommand(interp, "testlocale", TestlocaleCmd, NULL,
NULL);
Tcl_CreateCommand(interp, "testpanic", TestpanicCmd, NULL, NULL);
-#ifndef _WIN32
- Tcl_CreateObjCommand(interp, "testfinexit", TestfinexitObjCmd, NULL, NULL);
-#endif /* _WIN32 */
Tcl_CreateObjCommand(interp, "testparseargs", TestparseargsCmd,NULL,NULL);
Tcl_CreateObjCommand(interp, "testparser", TestparserObjCmd,
NULL, NULL);
@@ -4556,55 +4548,6 @@ TestpanicCmd(
return TCL_OK;
}
-/*
- *----------------------------------------------------------------------
- *
- * TestfinexitObjCmd --
- *
- * Calls a variant of [exit] including the full finalization path.
- *
- * On Win32, the test suite is run with all Tcltest funcions in a dll,
- * but TclpExit cannot be called from inside a dynamically loaded dll.
- * It would mean that the dll is terminated, while there is still a
- * function on the stack which belong to the dll.
- *
- * Results:
- * Error, or doesn't return.
- *
- * Side effects:
- * Exits application.
- *
- *----------------------------------------------------------------------
- */
-
-#ifndef _WIN32
-static int
-TestfinexitObjCmd(
- ClientData dummy, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *const objv[]) /* Argument objects. */
-{
- int value;
-
- if ((objc != 1) && (objc != 2)) {
- Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?");
- return TCL_ERROR;
- }
-
- if (objc == 1) {
- value = 0;
- } else if (Tcl_GetIntFromObj(interp, objv[1], &value) != TCL_OK) {
- return TCL_ERROR;
- }
- Tcl_Finalize();
- TclpExit(value);
- /*NOTREACHED*/
- return TCL_ERROR; /* Better not ever reach this! */
-}
-#endif /* _WIN32 */
-
-
static int
TestfileCmd(
ClientData dummy, /* Not used. */
diff --git a/tests/encoding.test b/tests/encoding.test
index 30aada0..306dd6d 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -37,7 +37,6 @@ proc runtests {} {
testConstraint testencoding [llength [info commands testencoding]]
testConstraint exec [llength [info commands exec]]
testConstraint testgetdefenc [llength [info commands testgetdefenc]]
-testConstraint testfinexit [llength [info commands testfinexit]]
# TclInitEncodingSubsystem is tested by the rest of this file
# TclFinalizeEncodingSubsystem is not currently tested
@@ -409,7 +408,6 @@ cd [workingDirectory]
# Code to make the next few tests more intelligible; the code being tested
# should be in the body of the test!
proc runInSubprocess {contents {filename iso2022.tcl}} {
- set contents "load $::tcltestlib Tcltest\n$contents"
set theFile [makeFile $contents $filename]
try {
exec [interpreter] $theFile
@@ -425,13 +423,14 @@ test encoding-24.1 {EscapeFreeProc on open channels} exec {
gets $f
}
} {}
-test encoding-24.2 {EscapeFreeProc on open channels} {exec testfinexit} {
+test encoding-24.2 {EscapeFreeProc on open channels} {exec} {
# Bug #524674 output
viewable [runInSubprocess {
encoding system cp1252; # Bug #2891556 crash revelator
fconfigure stdout -encoding iso2022-jp
puts ab\u4e4e\u68d9g
- testfinexit
+ set env(TCL_FINALIZE_ON_EXIT) 1
+ exit
}]
} "ab\x1b\$B8C\x1b\$(DD%\x1b(Bg (ab\\u001b\$B8C\\u001b\$(DD%\\u001b(Bg)"
test encoding-24.3 {EscapeFreeProc on open channels} {stdio} {
diff --git a/win/Makefile.in b/win/Makefile.in
index 63a01db..bb9a830 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -713,15 +713,15 @@ install-private-headers: libraries
test: test-tcl test-packages
-test-tcl: binaries $(TCLSH) $(CAT32) $(TEST_DLL_FILE) $(DDE_DLL_FILE) $(REG_DLL_FILE)
+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 dde 1.4.0b1 [list load [file normalize ${DDE_DLL_FILE}] dde]; \
package ifneeded registry 1.3.0 [list load [file normalize ${REG_DLL_FILE}] registry]" | ./$(CAT32)
-# Useful target to launch a built tcltest with the proper path,...
-runtest: binaries $(TCLSH) $(TEST_DLL_FILE) $(DDE_DLL_FILE) $(REG_DLL_FILE)
+# Useful target to launch a built tclsh with the proper path,...
+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 dde 1.4.0b1 [list load [file normalize ${DDE_DLL_FILE}] dde]; \