summaryrefslogtreecommitdiffstats
path: root/generic/tclTest.c
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2025-03-14 17:41:37 (GMT)
committersebres <sebres@users.sourceforge.net>2025-03-14 17:41:37 (GMT)
commit60f8d06e71f75a276f0dd41153fadc30d615c0de (patch)
tree98a9677bdcdbc3ff56251f1e890ed547782e531d /generic/tclTest.c
parent76760079f6e60b6dd81428de35dcb4f239af90d5 (diff)
parent2ee73911e6d04b8888fbeef91d819584e58210b0 (diff)
downloadtcl-60f8d06e71f75a276f0dd41153fadc30d615c0de.zip
tcl-60f8d06e71f75a276f0dd41153fadc30d615c0de.tar.gz
tcl-60f8d06e71f75a276f0dd41153fadc30d615c0de.tar.bz2
merge 8.7
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r--generic/tclTest.c59
1 files changed, 26 insertions, 33 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index b616825..a99fb99 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -512,39 +512,47 @@ static const char version[] = TCL_PATCH_LEVEL "+" STRINGIFY(TCL_VERSION_UUID)
;
int
-Tcltest_Init(
+TestCommonInit(
Tcl_Interp *interp) /* Interpreter for application. */
{
Tcl_CmdInfo info;
- Tcl_Obj **objv, *objPtr;
- Tcl_Size objc;
- int index;
- static const char *const specialOptions[] = {
- "-appinitprocerror", "-appinitprocdeleteinterp",
- "-appinitprocclosestderr", "-appinitprocsetrcfile", NULL
- };
if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
return TCL_ERROR;
}
- if (Tcl_OOInitStubs(interp) == NULL) {
- return TCL_ERROR;
- }
-
if (Tcl_GetCommandInfo(interp, "::tcl::build-info", &info)) {
-#if TCL_MAJOR_VERSION > 8
if (info.isNativeObjectProc == 2) {
Tcl_CreateObjCommand2(interp, "::tcl::test::build-info",
info.objProc2, (void *)version, NULL);
- } else
-#endif
- Tcl_CreateObjCommand(interp, "::tcl::test::build-info",
- info.objProc, (void *)version, NULL);
+ } else {
+ Tcl_CreateObjCommand(interp, "::tcl::test::build-info",
+ info.objProc, (void *)version, NULL);
+ }
}
if (Tcl_PkgProvideEx(interp, "tcl::test", TCL_PATCH_LEVEL, NULL) == TCL_ERROR) {
return TCL_ERROR;
}
+ return TCL_OK;
+}
+
+int
+Tcltest_Init(
+ Tcl_Interp *interp) /* Interpreter for application. */
+{
+ Tcl_Obj **objv, *objPtr;
+ Tcl_Size objc;
+ int index;
+ static const char *const specialOptions[] = {
+ "-appinitprocerror", "-appinitprocdeleteinterp",
+ "-appinitprocclosestderr", "-appinitprocsetrcfile", NULL
+ };
+ if (TestCommonInit(interp) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (Tcl_OOInitStubs(interp) == NULL) {
+ return TCL_ERROR;
+ }
/*
* Create additional commands and math functions for testing Tcl.
*/
@@ -795,22 +803,7 @@ int
Tcltest_SafeInit(
Tcl_Interp *interp) /* Interpreter for application. */
{
- Tcl_CmdInfo info;
-
- if (Tcl_InitStubs(interp, "8.7-", 0) == NULL) {
- return TCL_ERROR;
- }
- if (Tcl_GetCommandInfo(interp, "::tcl::build-info", &info)) {
-#if TCL_MAJOR_VERSION > 8
- if (info.isNativeObjectProc == 2) {
- Tcl_CreateObjCommand2(interp, "::tcl::test::build-info",
- info.objProc2, (void *)version, NULL);
- } else
-#endif
- Tcl_CreateObjCommand(interp, "::tcl::test::build-info",
- info.objProc, (void *)version, NULL);
- }
- if (Tcl_PkgProvideEx(interp, "tcl::test", TCL_PATCH_LEVEL, NULL) == TCL_ERROR) {
+ if (TestCommonInit(interp) != TCL_OK) {
return TCL_ERROR;
}
return Procbodytest_SafeInit(interp);