summaryrefslogtreecommitdiffstats
path: root/generic/tclTest.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r--generic/tclTest.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index ac01ecf..814d734 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -44,6 +44,7 @@
DLLEXPORT int Tcltest_Init(Tcl_Interp *interp);
DLLEXPORT int Tcltest_SafeInit(Tcl_Interp *interp);
+EXTERN TCL_NORETURN void Tcltest_Exit(ClientData clientData);
/*
* Dynamic string shared by TestdcallCmd and DelCallbackProc; used to collect
@@ -570,6 +571,10 @@ Tcltest_Init(
return TCL_ERROR;
}
+
+ /* Finalizer */
+ Tcl_SetExitProc(Tcltest_Exit);
+
/*
* Create additional commands and math functions for testing Tcl.
*/
@@ -797,6 +802,17 @@ Tcltest_SafeInit(
return Procbodytest_SafeInit(interp);
}
+TCL_NORETURN void Tcltest_Exit(
+ ClientData clientData
+) {
+ int status = PTR2INT(clientData);
+ Tcl_Finalize();
+ TclThreadTestFinalize();
+ TclpExit(status);
+ Tcl_Panic("OS exit failed!");
+}
+
+
/*
*----------------------------------------------------------------------
*