Compare commits

..
Author SHA1 Message Date
dkf dd45c8be9d Merge 8.7 2020-11-08 17:31:38 +00:00
dkf 40b3d4d5dd TIP 582: Comments in Expressions 2020-11-08 17:21:09 +00:00
dkf 25c115b5a8 Added badges to README 2020-11-08 13:38:20 +00:00
dkf d4ef5a261a Added experimental Windows CI build instructions 2020-11-08 13:34:03 +00:00
dkf 81a445ad46 Updated arrangement 2020-11-08 12:08:01 +00:00
dkf ca9f2d6210 Updated README 2020-11-07 14:29:06 +00:00
dkf 0b56647743 Updated workflow name 2020-11-07 14:21:15 +00:00
dkf f827fd2a9d Added basic github action starter 2020-11-07 14:14:17 +00:00
jan.nijtmans d60bc321ce Merge 8.6 2020-11-06 17:33:22 +00:00
jan.nijtmans 4404292972 Add MSVC "StaticPackage" build to travis. Fix another bug in winDde.test which didn't account for statically loaded dde package. 2020-11-06 17:17:41 +00:00
jan.nijtmans 82ffc550db Merge jn-module-names. Sorry Don, but this is 100% compatible! 2020-11-06 16:11:58 +00:00
jan.nijtmans 89e3b6811b Deprecate the (internal) functions TclGuessPackageName/TclGetLoadedPackages functions, since they turn out to be useless. The can be removed in 9.0 2020-11-06 14:43:48 +00:00
jan.nijtmans 3c53be5e75 Correct casing of "packageName" argument in Tcl_StaticPackage() call and "load" command (which - actually - is not a packageName at all ...)
UPDATE: I am moving this to a feature branch.  Changing the arguments passed to Tcl_StaticPackage will be an incompatible break for any scripts currently searching the [info loaded] list for "dde" or "registry".  Not a change we should put in a patchlevel without at least a ticket to record the explanation and a (POTENTIAL INCOMPATIBILITY) warning.
2020-11-06 13:32:39 +00:00
dkf b7efdfe9bc Merge 8.7 2020-11-01 14:25:49 +00:00
jan.nijtmans 63855497af Merge 8.7 2020-10-24 14:50:11 +00:00
dkf fe94c1d6c4 Tricky case in function calls. 2020-08-24 13:31:00 +00:00
dkf 1192757fb7 Added two test cases 2020-08-24 08:56:34 +00:00
dkf c76cad8a92 Added documentation 2020-08-22 14:24:31 +00:00
dkf 42a34d459e Implementation of TIP 582: comments in expressions 2020-08-22 14:14:05 +00:00
120 changed files with 688 additions and 616 deletions
+37
View File
@@ -0,0 +1,37 @@
name: Linux Build and Test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure
working-directory: unix
run: |
mkdir "${HOME}/install dir"
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
- name: Build
working-directory: unix
run: |
make all
- name: Build Test Harness
working-directory: unix
run: |
make tcltest
- name: Run Tests
working-directory: unix
run: |
make test
- name: Test-Drive Installation
working-directory: unix
run: |
make install
- name: Create Distribution Package
working-directory: unix
run: |
make dist
- name: Convert Documentation to HTML
working-directory: unix
run: |
make html-tcl
+37
View File
@@ -0,0 +1,37 @@
name: Linux Build and Test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure
working-directory: unix
run: |
mkdir "${HOME}/install dir"
./configure ${CFGOPT} "--prefix=$HOME/install dir" || (cat config.log && exit 1)
- name: Build
working-directory: unix
run: |
make all
- name: Build Test Harness
working-directory: unix
run: |
make tcltest
- name: Run Tests
working-directory: unix
run: |
make test
- name: Test-Drive Installation
working-directory: unix
run: |
make install
- name: Create Distribution Package
working-directory: unix
run: |
make dist
- name: Convert Documentation to HTML
working-directory: unix
run: |
make html-tcl
+22
View File
@@ -0,0 +1,22 @@
name: Windows Build and Test
on: [push]
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Init MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Build
working-directory: win
run: |
nmake -f makefile.vc all
- name: Build Test Harness
working-directory: win
run: |
nmake -f makefile.vc tcltest
- name: Run Tests
working-directory: win
run: |
nmake -f makefile.vc test
+15
View File
@@ -5,7 +5,22 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>
+9
View File
@@ -259,6 +259,15 @@ jobs:
script:
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,msvcrt' '-f' makefile.vc test
- name: "Windows/MSVC/StaticPackage"
os: windows
compiler: cl
env: *vcenv
before_install: *vcpreinst
install: []
script:
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc all tcltest
- cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc test
- name: "Windows/MSVC/Debug"
os: windows
compiler: cl
+11 -1
View File
@@ -5,7 +5,17 @@ This is the **Tcl 8.7a4** source distribution.
You can get any source release of Tcl from [our distribution
site](https://sourceforge.net/projects/tcl/files/Tcl/).
[![Build Status](https://travis-ci.org/tcltk/tcl.svg?branch=core-8-branch)](https://travis-ci.org/tcltk/tcl)
8.6.10
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-6-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=core-8-6-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-6-branch)
<br>
8.7a4
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Acore-8-branch)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=core-8-branch)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Acore-8-branch)
<br>
9.0a2
[![Build Status](https://github.com/tcltk/tcl/workflows/Linux%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Linux+Build+and+Test%22+branch%3Amain)
[![Build Status](https://github.com/tcltk/tcl/workflows/Windows%20Build%20and%20Test/badge.svg?branch=main)](https://github.com/tcltk/tcl/actions?query=workflow%3A%22Windows+Build+and+Test%22+branch%3Amain)
## Contents
1. [Introduction](#intro)
+2 -1
View File
@@ -22,7 +22,8 @@ already been loaded (i.e., the caller has already invoked the
appropriate initialization procedure). NULL means the package
has not yet been incorporated into any interpreter.
.AP "const char" *pkgName in
Name of the package.
Name of the package; should be properly capitalized (first letter
upper-case, all others lower-case).
.AP Tcl_PackageInitProc *initProc in
Procedure to invoke to incorporate this package into a trusted
interpreter.
+8
View File
@@ -41,6 +41,12 @@ When an expression evaluates to an integer, the value is the decimal form of
the integer, and when an expression evaluates to a floating-point number, the
value is the form produced by the \fB%g\fR format specifier of Tcl's
\fBformat\fR command.
.PP
.VS "TIP 582"
You can use \fB#\fR at any point in the expression (except inside double
quotes or braces) to start a comment. Comments last to the end of the line or
the end of the expression, whichever comes first.
.VE "TIP 582"
.SS OPERANDS
.PP
An expression consists of a combination of operands, operators, parentheses and
@@ -487,7 +493,9 @@ value of true:
.PP
.CS
set isTrue [\fBexpr\fR {
# Does the environment variable exist, and...
[info exists ::env(SOME_ENV_VAR)] &&
# ...does it contain a proper true value?
[string is true -strict $::env(SOME_ENV_VAR)]
}]
.CE
+1 -1
View File
@@ -14,7 +14,7 @@
zipfs \- Mount and work with ZIP files within Tcl
.SH SYNOPSIS
.nf
\fBpackage require tcl::zipfs \fR?\fB1.0\fR?
\fBpackage require zipfs \fR?\fB1.0\fR?
.sp
\fBzipfs canonical\fR ?\fImntpnt\fR? \fIfilename\fR ?\fIZIPFS\fR?
\fBzipfs exists\fR \fIfilename\fR
-1
View File
@@ -1175,7 +1175,6 @@ Tcl_CreateInterp(void)
*/
Tcl_PkgProvideEx(interp, "Tcl", TCL_PATCH_LEVEL, &tclStubs);
Tcl_PkgProvideEx(interp, "tcl", TCL_PATCH_LEVEL, &tclStubs);
if (TclTommath_Init(interp) != TCL_OK) {
Tcl_Panic("%s", TclGetString(Tcl_GetObjResult(interp)));
+48 -5
View File
@@ -164,6 +164,8 @@ enum Marks {
* "=" is encountered. */
#define INVALID 5 /* A parse error. Used when any punctuation
* appears that's not a supported operator. */
#define COMMENT 6 /* Comment. Lasts to end of line or end of
* expression, whichever comes first. */
/* Leaf lexemes */
@@ -462,7 +464,7 @@ static const unsigned char Lexeme[] = {
INVALID /* FS */, INVALID /* GS */,
INVALID /* RS */, INVALID /* US */,
INVALID /* SPACE */, 0 /* ! or != */,
QUOTED /* " */, INVALID /* # */,
QUOTED /* " */, 0 /* # */,
VARIABLE /* $ */, MOD /* % */,
0 /* & or && */, INVALID /* ' */,
OPEN_PAREN /* ( */, CLOSE_PAREN /* ) */,
@@ -674,9 +676,10 @@ ParseExpr(
OpNode *newPtr = NULL;
do {
if (size <= UINT_MAX/sizeof(OpNode)) {
newPtr = (OpNode *)attemptckrealloc(nodes, size * sizeof(OpNode));
}
if (size <= UINT_MAX/sizeof(OpNode)) {
newPtr = (OpNode *) attemptckrealloc(nodes,
size * sizeof(OpNode));
}
} while ((newPtr == NULL)
&& ((size -= (size - nodesUsed) / 2) > nodesUsed));
if (newPtr == NULL) {
@@ -708,6 +711,10 @@ ParseExpr(
int b;
switch (lexeme) {
case COMMENT:
start += scanned;
numBytes -= scanned;
continue;
case INVALID:
msg = Tcl_ObjPrintf("invalid character \"%.*s\"",
scanned, start);
@@ -742,6 +749,32 @@ ParseExpr(
} else if (Tcl_GetBooleanFromObj(NULL,literal,&b) == TCL_OK) {
lexeme = BOOLEAN;
} else {
/*
* Tricky case: see test expr-62.10
*/
int scanned2 = scanned;
do {
scanned2 += TclParseAllWhiteSpace(
start + scanned2, numBytes - scanned2);
scanned2 += ParseLexeme(
start + scanned2, numBytes - scanned2, &lexeme,
NULL);
} while (lexeme == COMMENT);
if (lexeme == OPEN_PAREN) {
/*
* Actually a function call, but with obscuring
* comments. Skip to the start of the parentheses.
* Note that we assume that open parentheses are one
* byte long.
*/
lexeme = FUNCTION;
Tcl_ListObjAppendElement(NULL, funcList, literal);
scanned = scanned2 - 1;
break;
}
Tcl_DecrRefCount(literal);
msg = Tcl_ObjPrintf("invalid bareword \"%.*s%s\"",
(scanned < limit) ? scanned : limit - 3, start,
@@ -1894,7 +1927,7 @@ ParseLexeme(
storage, if non-NULL. */
{
const char *end;
int scanned;
int scanned, size;
Tcl_UniChar ch = 0;
Tcl_Obj *literal = NULL;
unsigned char byte;
@@ -1909,6 +1942,16 @@ ParseLexeme(
return 1;
}
switch (byte) {
case '#':
/*
* Scan forward over the comment contents.
*/
for (size = 0; byte != '\n' && byte != 0 && size < numBytes; size++) {
byte = UCHAR(start[size]);
}
*lexemePtr = COMMENT;
return size - (byte == '\n');
case '*':
if ((numBytes > 1) && (start[1] == '*')) {
*lexemePtr = EXPON;
+5
View File
@@ -1413,4 +1413,9 @@ extern const TclIntStubs *tclIntStubsPtr;
# define Tcl_StaticPackage (tclIntStubsPtr->tclStaticPackage)
#endif
#undef TclGuessPackageName
#ifndef TCL_NO_DEPRECATED
# define TclGuessPackageName(fileName, pkgName) ((void)fileName,(void)pkgName,0)
#endif
#endif /* _TCLINTDECLS */
+78 -101
View File
@@ -226,8 +226,14 @@ Tcl_LoadObjCmd(
Tcl_DStringAppend(&pkgName, packageName, -1);
TclDStringClear(&tmp);
Tcl_DStringAppend(&tmp, pkgPtr->packageName, -1);
namesMatch = (strcmp(Tcl_DStringValue(&tmp),
Tcl_DStringValue(&pkgName)) == 0);
Tcl_UtfToLower(Tcl_DStringValue(&pkgName));
Tcl_UtfToLower(Tcl_DStringValue(&tmp));
if (strcmp(Tcl_DStringValue(&tmp),
Tcl_DStringValue(&pkgName)) == 0) {
namesMatch = 1;
} else {
namesMatch = 0;
}
}
TclDStringClear(&pkgName);
@@ -296,86 +302,79 @@ Tcl_LoadObjCmd(
if (packageName != NULL) {
Tcl_DStringAppend(&pkgName, packageName, -1);
} else {
int retc;
Tcl_Obj *splitPtr, *pkgGuessPtr;
int pElements;
const char *pkgGuess;
/*
* Threading note - this call used to be protected by a mutex.
*/
retc = TclGuessPackageName(fullFileName, &pkgName);
if (!retc) {
Tcl_Obj *splitPtr, *pkgGuessPtr;
int pElements;
const char *pkgGuess;
/*
* The platform-specific code couldn't figure out the module
* name. Make a guess by taking the last element of the file
* name, stripping off any leading "lib", and then using all
* of the alphabetic and underline characters that follow
* that.
*/
/*
* The platform-specific code couldn't figure out the module
* name. Make a guess by taking the last element of the file
* name, stripping off any leading "lib", and then using all
* of the alphabetic and underline characters that follow
* that.
*/
splitPtr = Tcl_FSSplitPath(objv[1], &pElements);
Tcl_ListObjIndex(NULL, splitPtr, pElements -1, &pkgGuessPtr);
pkgGuess = Tcl_GetString(pkgGuessPtr);
if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i')
&& (pkgGuess[2] == 'b')) {
pkgGuess += 3;
}
#ifdef __CYGWIN__
if ((pkgGuess[0] == 'c') && (pkgGuess[1] == 'y')
&& (pkgGuess[2] == 'g')) {
pkgGuess += 3;
}
#endif /* __CYGWIN__ */
for (p = pkgGuess; *p != 0; p += offset) {
offset = TclUtfToUniChar(p, &ch);
if ((ch > 0x100)
|| !(isalpha(UCHAR(ch)) /* INTL: ISO only */
|| (UCHAR(ch) == '_'))) {
break;
}
}
if (p == pkgGuess) {
Tcl_DecrRefCount(splitPtr);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't figure out package name for %s",
fullFileName));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD",
"WHATPACKAGE", NULL);
code = TCL_ERROR;
goto done;
}
Tcl_DStringAppend(&pkgName, pkgGuess, p - pkgGuess);
Tcl_DecrRefCount(splitPtr);
splitPtr = Tcl_FSSplitPath(objv[1], &pElements);
Tcl_ListObjIndex(NULL, splitPtr, pElements -1, &pkgGuessPtr);
pkgGuess = Tcl_GetString(pkgGuessPtr);
if ((pkgGuess[0] == 'l') && (pkgGuess[1] == 'i')
&& (pkgGuess[2] == 'b')) {
pkgGuess += 3;
}
#ifdef __CYGWIN__
else if ((pkgGuess[0] == 'c') && (pkgGuess[1] == 'y')
&& (pkgGuess[2] == 'g')) {
pkgGuess += 3;
}
#endif /* __CYGWIN__ */
for (p = pkgGuess; *p != 0; p += offset) {
offset = TclUtfToUniChar(p, &ch);
if ((ch > 0x100)
|| !(isalpha(UCHAR(ch)) /* INTL: ISO only */
|| (UCHAR(ch) == '_'))) {
break;
}
}
if (p == pkgGuess) {
Tcl_DecrRefCount(splitPtr);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't figure out package name for %s",
fullFileName));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD",
"WHATPACKAGE", NULL);
code = TCL_ERROR;
goto done;
}
Tcl_DStringAppend(&pkgName, pkgGuess, p - pkgGuess);
Tcl_DecrRefCount(splitPtr);
}
/*
* Compute the names of the initialization functions, based on the
* Fix the capitalization in the package name so that the first
* character is in caps (or title case) but the others are all
* lower-case.
*/
Tcl_DStringSetLength(&pkgName,
Tcl_UtfToTitle(Tcl_DStringValue(&pkgName)));
/*
* Compute the names of the two initialization functions, based on the
* package name.
*/
TclDStringAppendDString(&initName, &pkgName);
Tcl_DStringSetLength(&initName,
Tcl_UtfToTitle(Tcl_DStringValue(&initName)));
while (strchr(Tcl_DStringValue(&initName), ':') != NULL) {
char *r;
p = Tcl_DStringValue(&initName);
r = strchr((char *)p, ':');
if ((r != NULL) && (r[1] == ':')) {
memmove(r, r+2, strlen(r+1));
}
Tcl_DStringSetLength(&initName, strlen(p));
}
TclDStringAppendDString(&safeInitName, &initName);
TclDStringAppendLiteral(&safeInitName, "_SafeInit");
TclDStringAppendDString(&unloadName, &initName);
TclDStringAppendLiteral(&unloadName, "_Unload");
TclDStringAppendDString(&safeUnloadName, &initName);
TclDStringAppendLiteral(&safeUnloadName, "_SafeUnload");
TclDStringAppendLiteral(&initName, "_Init");
TclDStringAppendDString(&safeInitName, &pkgName);
TclDStringAppendLiteral(&safeInitName, "_SafeInit");
TclDStringAppendDString(&unloadName, &pkgName);
TclDStringAppendLiteral(&unloadName, "_Unload");
TclDStringAppendDString(&safeUnloadName, &pkgName);
TclDStringAppendLiteral(&safeUnloadName, "_SafeUnload");
/*
* Call platform-specific code to load the package and find the two
@@ -429,22 +428,6 @@ Tcl_LoadObjCmd(
*/
Tcl_ResetResult(interp);
} else {
Tcl_DStringAppend(&initName, pkgPtr->packageName, -1);
Tcl_DStringSetLength(&initName,
Tcl_UtfToTitle(Tcl_DStringValue(&initName)));
while (strchr(Tcl_DStringValue(&initName), ':') != NULL) {
char *r;
p = Tcl_DStringValue(&initName);
r = strchr((char *)p, ':');
if ((r != NULL) && (r[1] == ':')) {
memmove(r, r+2, strlen(r+1));
}
Tcl_DStringSetLength(&initName, strlen(p));
}
TclDStringAppendDString(&safeInitName, &initName);
TclDStringAppendLiteral(&safeInitName, "_SafeInit");
TclDStringAppendLiteral(&initName, "_Init");
}
/*
@@ -456,7 +439,7 @@ Tcl_LoadObjCmd(
if (pkgPtr->safeInitProc == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't use package in a safe interpreter: no"
" %s procedure", Tcl_DStringValue(&safeInitName)));
" %s_SafeInit procedure", pkgPtr->packageName));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD", "UNSAFE",
NULL);
code = TCL_ERROR;
@@ -466,8 +449,8 @@ Tcl_LoadObjCmd(
} else {
if (pkgPtr->initProc == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't attach package to interpreter: no %s procedure",
Tcl_DStringValue(&initName)));
"can't attach package to interpreter: no %s_Init procedure",
pkgPtr->packageName));
Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD", "ENTRYPOINT",
NULL);
code = TCL_ERROR;
@@ -675,8 +658,14 @@ Tcl_UnloadObjCmd(
Tcl_DStringAppend(&pkgName, packageName, -1);
TclDStringClear(&tmp);
Tcl_DStringAppend(&tmp, pkgPtr->packageName, -1);
namesMatch = (strcmp(Tcl_DStringValue(&tmp),
Tcl_DStringValue(&pkgName)) == 0);
Tcl_UtfToLower(Tcl_DStringValue(&pkgName));
Tcl_UtfToLower(Tcl_DStringValue(&tmp));
if (strcmp(Tcl_DStringValue(&tmp),
Tcl_DStringValue(&pkgName)) == 0) {
namesMatch = 1;
} else {
namesMatch = 0;
}
}
TclDStringClear(&pkgName);
@@ -1031,7 +1020,7 @@ Tcl_StaticPackage(
/*
*----------------------------------------------------------------------
*
* TclGetLoadedPackages, TclGetLoadedPackagesEx --
* TclGetLoadedPackagesEx --
*
* This function returns information about all of the files that are
* loaded (either in a particular interpreter, or for all interpreters).
@@ -1049,18 +1038,6 @@ Tcl_StaticPackage(
*----------------------------------------------------------------------
*/
int
TclGetLoadedPackages(
Tcl_Interp *interp, /* Interpreter in which to return information
* or error message. */
const char *targetName) /* Name of target interpreter or NULL. If
* NULL, return info about all interps;
* otherwise, just return info about this
* interpreter. */
{
return TclGetLoadedPackagesEx(interp, targetName, NULL);
}
int
TclGetLoadedPackagesEx(
Tcl_Interp *interp, /* Interpreter in which to return information
-30
View File
@@ -53,36 +53,6 @@ TclpDlopen(
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
* TclGuessPackageName --
*
* If the "load" command is invoked without providing a package name,
* this procedure is invoked to try to figure it out.
*
* Results:
* Always returns 0 to indicate that we couldn't figure out a package
* name; generic code will then try to guess the package from the file
* name. A return value of 1 would have meant that we figured out the
* package name and put it in bufPtr.
*
* Side effects:
* None.
*
*----------------------------------------------------------------------
*/
int
TclGuessPackageName(
const char *fileName, /* Name of file containing package (already
* translated to local form if needed). */
Tcl_DString *bufPtr) /* Initialized empty dstring. Append package
* name to this if possible. */
{
return 0;
}
/*
* These functions are fallbacks if we somehow determine that the platform can
* do loading from memory but the user wishes to disable it. They just report
+1 -8
View File
@@ -138,10 +138,7 @@ static const Tcl_MethodType classConstructor = {
*/
static const char *initScript =
#ifndef TCL_NO_DEPRECATED
"package ifneeded TclOO " TCLOO_PATCHLEVEL " {# Already present, OK?};"
#endif
"package ifneeded tcl::oo " TCLOO_PATCHLEVEL " {# Already present, OK?};"
"namespace eval ::oo { variable version " TCLOO_VERSION " };"
"namespace eval ::oo { variable patchlevel " TCLOO_PATCHLEVEL " };";
/* "tcl_findLibrary tcloo $oo::version $oo::version" */
@@ -260,11 +257,7 @@ TclOOInit(
return TCL_ERROR;
}
#ifndef TCL_NO_DEPRECATED
Tcl_PkgProvideEx(interp, "TclOO", TCLOO_PATCHLEVEL,
(void *) &tclOOStubs);
#endif
return Tcl_PkgProvideEx(interp, "tcl::oo", TCLOO_PATCHLEVEL,
return Tcl_PkgProvideEx(interp, "TclOO", TCLOO_PATCHLEVEL,
(void *) &tclOOStubs);
}
+2 -7
View File
@@ -35,19 +35,14 @@ TclOOInitializeStubs(
const char *version)
{
int exact = 0;
const char *packageName = "tcl::oo";
const char *packageName = "TclOO";
const char *errMsg = NULL;
TclOOStubs *stubsPtr = NULL;
const char *actualVersion = tclStubsPtr->tcl_PkgRequireEx(interp,
packageName, version, exact, &stubsPtr);
if (actualVersion == NULL) {
packageName = "TclOO";
actualVersion = tclStubsPtr->tcl_PkgRequireEx(interp,
packageName, version, exact, &stubsPtr);
if (actualVersion == NULL) {
return NULL;
}
return NULL;
}
if (stubsPtr == NULL) {
errMsg = "missing stub table pointer";
+22
View File
@@ -67,6 +67,8 @@
#undef TclWinNToHS
#undef TclStaticPackage
#undef Tcl_BackgroundError
#undef TclGuessPackageName
#undef TclGetLoadedPackages
#define TclStaticPackage Tcl_StaticPackage
#undef Tcl_UniCharToUtfDString
#undef Tcl_UtfToUniCharDString
@@ -261,8 +263,28 @@ mp_err TclBN_mp_mul_d(const mp_int *a, unsigned int b, mp_int *c) {
# define Tcl_ChannelCloseProc 0
# define Tcl_Close 0
# define Tcl_MacOSXOpenBundleResources 0
# define TclGuessPackageName 0
# define TclGetLoadedPackages 0
#else
#define TclGuessPackageName guessPackageName
static int TclGuessPackageName(
TCL_UNUSED(const char *),
TCL_UNUSED(Tcl_DString *)) {
return 0;
}
#define TclGetLoadedPackages getLoadedPackages
static int TclGetLoadedPackages(
Tcl_Interp *interp, /* Interpreter in which to return information
* or error message. */
const char *targetName) /* Name of target interpreter or NULL. If
* NULL, return info about all interps;
* otherwise, just return info about this
* interpreter. */
{
return TclGetLoadedPackagesEx(interp, targetName, NULL);
}
mp_err TclBN_mp_div_3(const mp_int *a, mp_int *c, unsigned int *d) {
mp_digit d2;
mp_err result = mp_div_d(a, 3, c, &d2);
+1 -1
View File
@@ -460,7 +460,7 @@ Tcltest_Init(
}
/* TIP #268: Full patchlevel instead of just major.minor */
if (Tcl_PkgProvideEx(interp, "tcl::test", TCL_PATCH_LEVEL, NULL) == TCL_ERROR) {
if (Tcl_PkgProvideEx(interp, "Tcltest", TCL_PATCH_LEVEL, NULL) == TCL_ERROR) {
return TCL_ERROR;
}
+4 -4
View File
@@ -20,7 +20,7 @@
* name and version of this package
*/
static const char packageName[] = "tcl::procbodytest";
static const char packageName[] = "procbodytest";
static const char packageVersion[] = "1.1";
/*
@@ -75,7 +75,7 @@ static const CmdTable safeCommands[] = {
*
* Procbodytest_Init --
*
* This function initializes the "tcl::procbodytest" package.
* This function initializes the "procbodytest" package.
*
* Results:
* A standard Tcl result.
@@ -99,7 +99,7 @@ Procbodytest_Init(
*
* Procbodytest_SafeInit --
*
* This function initializes the "tcl::procbodytest" package.
* This function initializes the "procbodytest" package.
*
* Results:
* A standard Tcl result.
@@ -315,7 +315,7 @@ ProcBodyTestProcObjCmd(
* procbodytest::check
*
* Performs an internal check that the Tcl_PkgPresent() command returns
* the same version number as was registered when the tcl::procbodytest package
* the same version number as was registered when the procbodytest package
* was provided. Places a boolean in the interp result indicating the
* test outcome.
*
+1 -1
View File
@@ -4771,7 +4771,7 @@ TclZipfs_Init(
Tcl_NewStringObj("::tcl::zipfs::find", -1));
Tcl_CreateObjCommand(interp, "::tcl::zipfs::tcl_library_init",
ZipFSTclLibraryObjCmd, NULL, NULL);
Tcl_PkgProvide(interp, "tcl::zipfs", "2.0");
Tcl_PkgProvide(interp, "zipfs", "2.0");
}
return TCL_OK;
#else /* !HAVE_ZLIB */
+1 -4
View File
@@ -3957,10 +3957,7 @@ TclZlibInit(
* Formally provide the package as a Tcl built-in.
*/
#ifndef TCL_NO_DEPRECATED
Tcl_PkgProvide(interp, "zlib", TCL_ZLIB_VERSION);
#endif
return Tcl_PkgProvide(interp, "tcl::zlib", TCL_ZLIB_VERSION);
return Tcl_PkgProvide(interp, "zlib", TCL_ZLIB_VERSION);
}
/*
+1 -1
View File
@@ -1,3 +1,3 @@
if {![package vsatisfies [package provide Tcl] 8.5-]} return
if {[info sharedlibextension] != ".dll"} return
package ifneeded dde 1.4.3 [list load [file join $dir tcldde14.dll] dde]
package ifneeded dde 1.4.3 [list load [file join $dir tcldde14.dll] Dde]
+1 -1
View File
@@ -1,4 +1,4 @@
if {![package vsatisfies [package provide Tcl] 8.5-]} return
if {[info sharedlibextension] != ".dll"} return
package ifneeded registry 1.3.5 \
[list load [file join $dir tclreg13.dll] registry]
[list load [file join $dir tclreg13.dll] Registry]
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testgetassocdata [llength [info commands testgetassocdata]]
testConstraint testsetassocdata [llength [info commands testsetassocdata]]
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testasync [llength [info commands testasync]]
testConstraint knownMsvcBug [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match windows $::env(TRAVIS_OS_NAME)]}]
+1 -1
View File
@@ -21,7 +21,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testevalex [llength [info commands testevalex]]
testConstraint testcmdtoken [llength [info commands testcmdtoken]]
+4 -4
View File
@@ -36,8 +36,8 @@ namespace eval ::tcl::test::io {
catch {
::tcltest::loadTestedCommands
package require -exact tcl::test [info patchlevel]
set ::tcltestlib [lindex [package ifneeded tcl::test [info patchlevel]] 1]
package require -exact Tcltest [info patchlevel]
set ::tcltestlib [lindex [package ifneeded Tcltest [info patchlevel]] 1]
}
package require tcltests
@@ -7493,7 +7493,7 @@ test chan-io-59.1 {Thread reference of channels} {testmainthread testchannel} {
test chan-io-60.1 {writing illegal utf sequences} {fileevent testbytestring} {
# This test will hang in older revisions of the core.
set out [open $path(script) w]
chan puts $out "catch {load $::tcltestlib tcl::test}"
chan puts $out "catch {load $::tcltestlib Tcltest}"
chan puts $out {
chan puts [testbytestring \xe2]
exit 1
@@ -7576,7 +7576,7 @@ test chan-io-70.1 {Transfer channel} -setup {
lappend res [catch {chan seek $c 0 start}]
set tid [thread::create -preserved]
thread::send $tid [list set c $c]
thread::send $tid {load {} tcl::test}
thread::send $tid {load {} Tcltest}
lappend res [thread::send $tid {
testchannel splice $c
set res [catch {chan seek $c 0 start}]
+1 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testchmod [llength [info commands testchmod]]
testConstraint testsetplatform [llength [info commands testsetplatform]]
+1 -1
View File
@@ -15,7 +15,7 @@ if {"::tcltest" ni [namespace children]} {
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Used for constraining memory leak tests
testConstraint memory [llength [info commands memory]]
+1 -1
View File
@@ -19,7 +19,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testcmdinfo [llength [info commands testcmdinfo]]
testConstraint testcmdtoken [llength [info commands testcmdtoken]]
+1 -1
View File
@@ -19,7 +19,7 @@ if {"::tcltest" ni [namespace children]} {
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Big test for correct ordering of data in [expr]
+37 -1
View File
@@ -14,7 +14,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Constrain memory leak tests
testConstraint memory [llength [info commands memory]]
@@ -371,10 +371,46 @@ test compExpr-7.2 {[Bug 1869989]: expr parser memleak} -constraints memory -setu
unset end i tmp
rename getbytes {}
} -result 0
proc extract {opcodes descriptor} {
set instructions [dict values [dict get $descriptor instructions]]
return [lmap i $instructions {
if {[lindex $i 0] in $opcodes} {string cat $i} else continue
}]
}
test compExpr-8.1 {TIP 582: expression comments} -setup {} -body {
extract {loadStk add} [tcl::unsupported::getbytecode script {expr {
$abc
# + $def
+ $ghi
}}]
} -result {loadStk loadStk add}
test compExpr-8.2 {TIP 582: expression comments} -setup {} -body {
extract {loadStk add} [tcl::unsupported::getbytecode script {expr {
$abc
# + $def
# + $ghi }}]
} -result loadStk
test compExpr-8.3 {TIP 582: expression comments} -setup {} -body {
extract {loadStk add} [tcl::unsupported::getbytecode script {expr {
$abc
# + $def\
+ $ghi
}}]
} -result loadStk
test compExpr-8.4 {TIP 582: expression comments} -setup {} -body {
extract {loadStk add} [tcl::unsupported::getbytecode script {expr {
$abc
# + $def\\
+ $ghi
}}]
} -result {loadStk loadStk add}
# cleanup
catch {unset a}
catch {unset b}
catch {rename extract ""}
::tcltest::cleanupTests
return
+1 -1
View File
@@ -18,7 +18,7 @@ if {"::tcltest" ni [namespace children]} {
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint exec [llength [info commands exec]]
testConstraint memory [llength [info commands memory]]
+1 -1
View File
@@ -15,7 +15,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testnrelevels [llength [info commands testnrelevels]]
testConstraint memory [llength [info commands memory]]
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testdcall [llength [info commands testdcall]]
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testdstring [llength [info commands testdstring]]
if {[testConstraint testdstring]} {
+1 -1
View File
@@ -19,7 +19,7 @@ namespace eval ::tcl::test::encoding {
catch {
::tcltest::loadTestedCommands
package require -exact tcl::test [info patchlevel]
package require -exact Tcltest [info patchlevel]
}
proc toutf {args} {
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
package require tcltests
# [exec] is required here to see the actual environment received by child
+7 -7
View File
@@ -14,8 +14,8 @@ namespace import -force ::tcltest::*
catch {
::tcltest::loadTestedCommands
package require -exact tcl::test [info patchlevel]
set ::tcltestlib [lindex [package ifneeded tcl::test [info patchlevel]] 1]
package require -exact Tcltest [info patchlevel]
set ::tcltestlib [lindex [package ifneeded Tcltest [info patchlevel]] 1]
}
@@ -436,7 +436,7 @@ catch {rename bgerror {}}
test event-8.1 {Tcl_CreateExitHandler procedure} {stdio testexithandler} {
set child [open |[list [interpreter]] r+]
puts $child "catch {load $::tcltestlib tcl::test}"
puts $child "catch {load $::tcltestlib Tcltest}"
puts $child "testexithandler create 41; testexithandler create 4"
puts $child "testexithandler create 6; exit"
flush $child
@@ -450,7 +450,7 @@ odd 41
test event-9.1 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} {
set child [open |[list [interpreter]] r+]
puts $child "catch {load $::tcltestlib tcl::test}"
puts $child "catch {load $::tcltestlib Tcltest}"
puts $child "testexithandler create 41; testexithandler create 4"
puts $child "testexithandler create 6; testexithandler delete 41"
puts $child "testexithandler create 16; exit"
@@ -464,7 +464,7 @@ even 4
}
test event-9.2 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} {
set child [open |[list [interpreter]] r+]
puts $child "catch {load $::tcltestlib tcl::test}"
puts $child "catch {load $::tcltestlib Tcltest}"
puts $child "testexithandler create 41; testexithandler create 4"
puts $child "testexithandler create 6; testexithandler delete 4"
puts $child "testexithandler create 16; exit"
@@ -478,7 +478,7 @@ odd 41
}
test event-9.3 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} {
set child [open |[list [interpreter]] r+]
puts $child "catch {load $::tcltestlib tcl::test}"
puts $child "catch {load $::tcltestlib Tcltest}"
puts $child "testexithandler create 41; testexithandler create 4"
puts $child "testexithandler create 6; testexithandler delete 6"
puts $child "testexithandler create 16; exit"
@@ -492,7 +492,7 @@ odd 41
}
test event-9.4 {Tcl_DeleteExitHandler procedure} {stdio testexithandler} {
set child [open |[list [interpreter]] r+]
puts $child "catch {load $::tcltestlib tcl::test}"
puts $child "catch {load $::tcltestlib Tcltest}"
puts $child "testexithandler create 41; testexithandler delete 41"
puts $child "testexithandler create 16; exit"
flush $child
+1 -1
View File
@@ -20,7 +20,7 @@ if {"::tcltest" ni [namespace children]} {
}
loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
package require tcltests
# All tests require the "exec" command.
+5 -5
View File
@@ -20,7 +20,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
catch {namespace delete {*}[namespace children :: test_ns_*]}
catch {rename foo ""}
@@ -683,12 +683,12 @@ test execute-6.11 {Tcl_ExprObj: exprcode interp validation} -setup {
} -constraints testexprlongobj -body {
set e { [llength {}]+1 }
set result {}
load {} tcl::test child
load {} Tcltest child
interp alias {} e child testexprlongobj
lappend result [e $e]
interp delete child
interp create child
load {} tcl::test child
load {} Tcltest child
interp alias {} e child testexprlongobj
lappend result [e $e]
} -cleanup {
@@ -985,7 +985,7 @@ test execute-8.6 {Compile epoch bump in global level (bug [fa6bf38d07])} -setup
interp create child
child eval {
package require tcltest 2.5
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
::tcltest::loadTestedCommands
if {[namespace which -command testbumpinterpepoch] eq ""} {
proc testbumpinterpepoch {} { rename ::set ::dummy; rename ::dummy ::set }
@@ -1018,7 +1018,7 @@ test execute-8.7 {Compile epoch bump in global level (bug [fa6bf38d07]), excepti
interp create child
child eval {
package require tcltest 2.5
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
::tcltest::loadTestedCommands
if {[namespace which -command testbumpinterpepoch] eq ""} {
proc testbumpinterpepoch {} { rename ::set ::dummy; rename ::dummy ::set }
+2 -2
View File
@@ -19,7 +19,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testexprlong [llength [info commands testexprlong]]
testConstraint testexprdouble [llength [info commands testexprdouble]]
@@ -524,7 +524,7 @@ test expr-old-26.10b {error conditions} ieeeFloatingPoint {
list [catch {expr 2.0/0.0} msg] $msg
} {0 Inf}
test expr-old-26.11 {error conditions} -body {
expr 2#
expr 2`
} -returnCodes error -match glob -result *
test expr-old-26.12 {error conditions} -body {
expr a.b
+62 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Determine if "long int" type is a 32 bit number and if the wide
# type is a 64 bit number on this machine.
@@ -7384,6 +7384,67 @@ foreach v1 $values r1 $results {
}
}
unset -nocomplain values results ctr
test expr-62.1 {TIP 582: comments} -body {
expr {1 # + 2}
} -result 1
test expr-62.2 {TIP 582: comments} -body {
expr "1 #\n+ 2"
} -result 3
test expr-62.3 {TIP 582: comments} -setup {
set ctr 0
} -body {
expr {
# This is a demonstration of a comment
1 + 2 + 3
# and another comment
+ 4 + 5
# + [incr ctr]
+ [incr ctr]
}
} -result 16
# Buggy because line breaks aren't tracked inside expressions at all
test expr-62.4 {TIP 582: comments don't hide line breaks} -setup {
proc getline {} {
dict get [info frame -1] line
}
set base [getline]
} -constraints knownBug -body {
expr {
0
# a comment
+ [getline] - $base
}
} -cleanup {
rename getline ""
} -result 5
test expr-62.5 {TIP 582: comments don't splice tokens} {
set a False
expr {$a#don't splice
ne#don't splice
false}
} 1
test expr-62.6 {TIP 582: comments don't splice tokens} {
expr {0x2#don't splice
ne#don't splice
2}
} 1
test expr-62.7 {TIP 582: comments can go inside function calls} {
expr {max(1,# comment
2)}
} 2
test expr-62.8 {TIP 582: comments can go inside function calls} {
expr {max(1# comment
,2)}
} 2
test expr-62.9 {TIP 582: comments can go inside function calls} {
expr {max(# comment
1,2)}
} 2
test expr-62.10 {TIP 582: comments can go inside function calls} {
expr {max# comment
(1,2)}
} 2
# cleanup
unset -nocomplain a
+1 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
cd [temporaryDirectory]
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testsetplatform [llength [info commands testsetplatform]]
testConstraint testtranslatefilename [llength [info commands testtranslatefilename]]
+2 -2
View File
@@ -25,7 +25,7 @@ namespace eval ::tcl::test::fileSystem {
testConstraint loaddll 0
catch {
::tcltest::loadTestedCommands
package require -exact tcl::test [info patchlevel]
package require -exact Tcltest [info patchlevel]
set ::ddever [package require dde]
set ::ddelib [lindex [package ifneeded dde $::ddever] 1]
set ::regver [package require registry]
@@ -33,7 +33,7 @@ catch {
testConstraint loaddll 1
}
# Test for commands defined in tcl::test package
# Test for commands defined in Tcltest executable
testConstraint testfilesystem [llength [info commands ::testfilesystem]]
testConstraint testsetplatform [llength [info commands ::testsetplatform]]
testConstraint testsimplefilesystem [llength [info commands ::testsimplefilesystem]]
+1 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testgetint [llength [info commands testgetint]]
testConstraint testdoubleobj [llength [info commands testdoubleobj]]
+1 -1
View File
@@ -14,7 +14,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testindexobj [llength [info commands testindexobj]]
testConstraint testparseargs [llength [info commands testparseargs]]
+1 -1
View File
@@ -20,7 +20,7 @@ if {{::tcltest} ni [namespace children]} {
namespace import -force ::tcltest::*
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint zlib [llength [info commands zlib]]
# Set up namespaces needed to test operation of "info args", "info body",
+1 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testinterpdelete [llength [info commands testinterpdelete]]
+4 -4
View File
@@ -31,8 +31,8 @@ namespace eval ::tcl::test::io {
catch {
::tcltest::loadTestedCommands
package require -exact tcl::test [info patchlevel]
set ::tcltestlib [lindex [package ifneeded tcl::test [info patchlevel]] 1]
package require -exact Tcltest [info patchlevel]
set ::tcltestlib [lindex [package ifneeded Tcltest [info patchlevel]] 1]
}
package require tcltests
@@ -8385,7 +8385,7 @@ test io-60.1 {writing illegal utf sequences} {fileevent testbytestring} {
# This test will hang in older revisions of the core.
set out [open $path(script) w]
puts $out "catch {load $::tcltestlib tcl::test}"
puts $out "catch {load $::tcltestlib Tcltest}"
puts $out {
puts [testbytestring \xe2]
exit 1
@@ -8477,7 +8477,7 @@ test io-70.1 {Transfer channel} {testchannel thread} {
set tid [thread::create -preserved]
thread::send $tid [list set c $c]
thread::send $tid {load {} tcl::test}
thread::send $tid {load {} Tcltest}
lappend res [thread::send $tid {
testchannel splice $c
set res [catch {seek $c 0 start}]
+11 -11
View File
@@ -19,7 +19,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
package require tcltests
@@ -2085,8 +2085,8 @@ test iocmd-32.0 {origin interpreter of moved channel gone} -match glob -body {
set idb [interp create];#puts <<$idb>>
# Magic to get the test* commands in the children
load {} tcl::test $ida
load {} tcl::test $idb
load {} Tcltest $ida
load {} Tcltest $idb
# Set up channel in interpreter
interp eval $ida $helperscript
@@ -2123,8 +2123,8 @@ test iocmd-32.1 {origin interpreter of moved channel destroyed during access} -m
set idb [interp create];#puts <<$idb>>
# Magic to get the test* commands in the children
load {} tcl::test $ida
load {} tcl::test $idb
load {} Tcltest $ida
load {} Tcltest $idb
# Set up channel in thread
set chan [interp eval $ida $helperscript]
@@ -2194,7 +2194,7 @@ proc inthread {chan script args} {
# Test thread.
set tid [thread::create -preserved]
thread::send $tid {load {} tcl::test}
thread::send $tid {load {} Tcltest}
# Init thread configuration.
# - Listed variables
@@ -2833,7 +2833,7 @@ test iocmd.tf-24.17.bug3522560 {postevent for transfered channel} \
return
}
LOG THREAD-STARTED
load {} tcl::test
load {} Tcltest
proc bgerror s {
LOG BGERROR:$s
}
@@ -3790,10 +3790,10 @@ test iocmd.tf-32.0 {origin thread of moved channel gone} -match glob -body {
#puts <<$tcltest::mainThread>>main
set tida [thread::create -preserved];#puts <<$tida>>
thread::send $tida {load {} tcl::test}
thread::send $tida {load {} Tcltest}
set tidb [thread::create -preserved];#puts <<$tidb>>
thread::send $tidb {load {} tcl::test}
thread::send $tidb {load {} Tcltest}
# Set up channel in thread
thread::send $tida $helperscript
@@ -3840,9 +3840,9 @@ test iocmd.tf-32.1 {origin thread of moved channel destroyed during access} -mat
#puts <<$tcltest::mainThread>>main
set tida [thread::create -preserved];#puts <<$tida>>
thread::send $tida {load {} tcl::test}
thread::send $tida {load {} Tcltest}
set tidb [thread::create -preserved];#puts <<$tidb>>
thread::send $tidb {load {} tcl::test}
thread::send $tidb {load {} Tcltest}
# Set up channel in thread
thread::send $tida $helperscript
+11 -11
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Custom constraints used in this file
testConstraint testchannel [llength [info commands testchannel]]
@@ -1163,8 +1163,8 @@ test iortrans-11.0 {origin interpreter of moved transform gone} -setup {
set ida [interp create]; #puts <<$ida>>
set idb [interp create]; #puts <<$idb>>
# Magic to get the test* commands in the children
load {} tcl::test $ida
load {} tcl::test $idb
load {} Tcltest $ida
load {} Tcltest $idb
} -constraints {testchannel} -match glob -body {
# Set up channel and transform in interpreter
interp eval $ida $helperscript
@@ -1206,8 +1206,8 @@ test iortrans-11.1 {origin interpreter of moved transform destroyed during acces
set ida [interp create]; #puts <<$ida>>
set idb [interp create]; #puts <<$idb>>
# Magic to get the test* commands in the children
load {} tcl::test $ida
load {} tcl::test $idb
load {} Tcltest $ida
load {} Tcltest $idb
} -constraints {testchannel} -match glob -body {
# Set up channel in thread
set chan [interp eval $ida $helperscript]
@@ -1246,7 +1246,7 @@ test iortrans-11.1 {origin interpreter of moved transform destroyed during acces
test iortrans-11.2 {delete interp of reflected transform} -setup {
interp create child
# Magic to get the test* commands into the child
load {} tcl::test child
load {} Tcltest child
} -constraints {testchannel} -body {
# Get base channel into the child
set c [tempchan]
@@ -1285,7 +1285,7 @@ test iortrans-11.2 {delete interp of reflected transform} -setup {
proc inthread {chan script args} {
# Test thread.
set tid [thread::create -preserved]
thread::send $tid {load {} tcl::test}
thread::send $tid {load {} Tcltest}
# Init thread configuration.
# - Listed variables
@@ -2002,9 +2002,9 @@ test iortrans.tf-8.2 {close flushes write buffers, writes data} -setup {
test iortrans.tf-11.0 {origin thread of moved transform gone} -setup {
#puts <<$tcltest::mainThread>>main
set tida [thread::create -preserved]; #puts <<$tida>>
thread::send $tida {load {} tcl::test}
thread::send $tida {load {} Tcltest}
set tidb [thread::create -preserved]; #puts <<$tida>>
thread::send $tidb {load {} tcl::test}
thread::send $tidb {load {} Tcltest}
} -constraints {testchannel thread} -match glob -body {
# Set up channel in thread
thread::send $tida $helperscript
@@ -2046,9 +2046,9 @@ testConstraint notValgrind [expr {![testConstraint valgrind]}]
test iortrans.tf-11.1 {origin thread of moved transform destroyed during access} -setup {
#puts <<$tcltest::mainThread>>main
set tida [thread::create -preserved]; #puts <<$tida>>
thread::send $tida {load {} tcl::test}
thread::send $tida {load {} Tcltest}
set tidb [thread::create -preserved]; #puts <<$tidb>>
thread::send $tidb {load {} tcl::test}
thread::send $tidb {load {} Tcltest}
} -constraints {testchannel thread notValgrind} -match glob -body {
# Set up channel in thread
thread::send $tida $helperscript
+1 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
namespace eval ::tcl::test::iogt {
namespace import ::tcltest::*
+1 -1
View File
@@ -18,7 +18,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
set minus -
testConstraint testevalex [llength [info commands testevalex]]
+2 -2
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testlink [llength [info commands testlink]]
testConstraint testlinkarray [llength [info commands testlinkarray]]
@@ -28,7 +28,7 @@ foreach i {int real bool string} {
test link-0.1 {leak test} {testlink} {
interp create i
load {} tcl::test i
load {} Tcltest i
i eval {
testlink create 1 0 0 0 0 0 0 0 0 0 0 0 0 0
namespace delete ::
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testobj [llength [info commands testobj]]
+36 -36
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Figure out what extension is used for shared libraries on this
# platform.
@@ -78,7 +78,7 @@ test load-2.1 {basic loading, with guess for package name} \
interp create -safe child
test load-2.2 {loading into a safe interpreter, with package name conversion} \
[list $dll $loaded] {
load -lazy [file join $testDir pkgb$ext] Pkgb child
load -lazy [file join $testDir pkgb$ext] pKgB child
list [child eval pkgb_sub 44 13] [catch {child eval pkgb_unsafe} msg] $msg \
[catch {pkgb_sub 12 10} msg2] $msg2
} {31 1 {invalid command name "pkgb_unsafe"} 1 {invalid command name "pkgb_sub"}}
@@ -127,8 +127,8 @@ test load-4.1 {reloading package into same interpreter} [list $dll $loaded] {
test load-4.2 {reloading package into same interpreter} -setup {
catch {load [file join $testDir pkga$ext] pkga}
} -constraints [list $dll $loaded] -returnCodes error -body {
load [file join $testDir pkga$ext] Pkgb
} -result "file \"[file join $testDir pkga$ext]\" is already loaded for package \"pkga\""
load [file join $testDir pkga$ext] pkgb
} -result "file \"[file join $testDir pkga$ext]\" is already loaded for package \"Pkga\""
test load-5.1 {file name not specified and no static package: pick default} -setup {
catch {interp delete x}
@@ -139,7 +139,7 @@ test load-5.1 {file name not specified and no static package: pick default} -set
info loaded x
} -cleanup {
interp delete x
} -result [list [list [file join $testDir pkga$ext] pkga]]
} -result [list [list [file join $testDir pkga$ext] Pkga]]
# On some platforms, like SunOS 4.1.3, these tests can't be run because
# they cause the process to exit.
@@ -152,89 +152,89 @@ test load-6.1 {errors loading file} [list $dll $loaded] {
test load-7.1 {Tcl_StaticPackage procedure} [list teststaticpkg] {
set x "not loaded"
teststaticpkg test 1 0
load {} test
load {} test child
teststaticpkg Test 1 0
load {} Test
load {} Test child
list [set x] [child eval set x]
} {loaded loaded}
test load-7.2 {Tcl_StaticPackage procedure} [list teststaticpkg] {
set x "not loaded"
teststaticpkg another 0 0
load {} another
teststaticpkg Another 0 0
load {} Another
child eval {set x "not loaded"}
list [catch {load {} another child} msg] $msg \
list [catch {load {} Another child} msg] $msg \
[child eval set x] [set x]
} {1 {can't use package in a safe interpreter: no Another_SafeInit procedure} {not loaded} loaded}
test load-7.3 {Tcl_StaticPackage procedure} [list teststaticpkg] {
set x "not loaded"
teststaticpkg more 0 1
load {} more
teststaticpkg More 0 1
load {} More
set x
} {not loaded}
catch {load [file join $testDir pkga$ext] pkga}
catch {load [file join $testDir pkgb$ext] Pkgb}
catch {load [file join $testDir pkgb$ext] pkgb}
catch {load [file join $testDir pkge$ext] pkge}
set currentRealPackages [list [list [file join $testDir pkge$ext] pkge] [list [file join $testDir pkgb$ext] Pkgb] [list [file join $testDir pkga$ext] pkga]]
set currentRealPackages [list [list [file join $testDir pkge$ext] Pkge] [list [file join $testDir pkgb$ext] Pkgb] [list [file join $testDir pkga$ext] Pkga]]
test load-7.4 {Tcl_StaticPackage procedure, redundant calls} -setup {
teststaticpkg test 1 0
teststaticpkg another 0 0
teststaticpkg more 0 1
teststaticpkg Test 1 0
teststaticpkg Another 0 0
teststaticpkg More 0 1
} -constraints [list teststaticpkg $dll $loaded] -body {
teststaticpkg double 0 1
teststaticpkg double 0 1
teststaticpkg Double 0 1
teststaticpkg Double 0 1
info loaded
} -result [list {{} double} {{} more} {{} another} {{} test} {*}$currentRealPackages {*}$alreadyTotalLoaded]
} -result [list {{} Double} {{} More} {{} Another} {{} Test} {*}$currentRealPackages {*}$alreadyTotalLoaded]
testConstraint teststaticpkg_8.x 0
if {[testConstraint teststaticpkg]} {
catch {
teststaticpkg test 1 1
teststaticpkg another 0 1
teststaticpkg more 0 1
teststaticpkg double 0 1
teststaticpkg Test 1 1
teststaticpkg Another 0 1
teststaticpkg More 0 1
teststaticpkg Double 0 1
testConstraint teststaticpkg_8.x 1
}
}
test load-8.1 {TclGetLoadedPackages procedure} [list teststaticpkg_8.x $dll $loaded] {
lsort -index 1 [info loaded]
} [lsort -index 1 [list {{} double} {{} more} {{} another} {{} test} {*}$currentRealPackages {*}$alreadyTotalLoaded]]
} [lsort -index 1 [list {{} Double} {{} More} {{} Another} {{} Test} {*}$currentRealPackages {*}$alreadyTotalLoaded]]
test load-8.2 {TclGetLoadedPackages procedure} -constraints {teststaticpkg_8.x} -body {
info loaded gorp
} -returnCodes error -result {could not find interpreter "gorp"}
test load-8.3a {TclGetLoadedPackages procedure} [list teststaticpkg_8.x $dll $loaded] {
lsort -index 1 [info loaded {}]
} [lsort -index 1 [list {{} double} {{} more} {{} another} {{} test} [list [file join $testDir pkga$ext] pkga] [list [file join $testDir pkgb$ext] Pkgb] {*}$alreadyLoaded]]
} [lsort -index 1 [list {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir pkga$ext] Pkga] [list [file join $testDir pkgb$ext] Pkgb] {*}$alreadyLoaded]]
test load-8.3b {TclGetLoadedPackages procedure} [list teststaticpkg_8.x $dll $loaded] {
lsort -index 1 [info loaded child]
} [lsort -index 1 [list {{} test} [list [file join $testDir pkgb$ext] Pkgb]]]
} [lsort -index 1 [list {{} Test} [list [file join $testDir pkgb$ext] Pkgb]]]
test load-8.4 {TclGetLoadedPackages procedure} [list teststaticpkg_8.x $dll $loaded] {
load [file join $testDir pkgb$ext] Pkgb
load [file join $testDir pkgb$ext] pkgb
list [lsort -index 1 [info loaded {}]] [lsort [info commands pkgb_*]]
} [list [lsort -index 1 [concat [list [list [file join $testDir pkgb$ext] Pkgb] {{} double} {{} more} {{} another} {{} test} [list [file join $testDir pkga$ext] pkga]] $alreadyLoaded]] {pkgb_demo pkgb_sub pkgb_unsafe}]
} [list [lsort -index 1 [concat [list [list [file join $testDir pkgb$ext] Pkgb] {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir pkga$ext] Pkga]] $alreadyLoaded]] {pkgb_demo pkgb_sub pkgb_unsafe}]
interp delete child
test load-9.1 {Tcl_StaticPackage, load already-loaded package into another interp} -setup {
interp create child1
interp create child2
load {} tcl::test child1
load {} tcl::test child2
load {} Tcltest child1
load {} Tcltest child2
} -constraints {teststaticpkg} -body {
child1 eval { teststaticpkg loadninepointone 0 1 }
child2 eval { teststaticpkg loadninepointone 0 1 }
child1 eval { teststaticpkg Loadninepointone 0 1 }
child2 eval { teststaticpkg Loadninepointone 0 1 }
list [child1 eval { info loaded {} }] \
[child2 eval { info loaded {} }]
} -match glob -cleanup {
interp delete child1
interp delete child2
} -result {{{{} loadninepointone} {* tcl::test}} {{{} loadninepointone} {* tcl::test}}}
} -result {{{{} Loadninepointone} {* Tcltest}} {{{} Loadninepointone} {* Tcltest}}}
test load-10.1 {load from vfs} -setup {
set dir [pwd]
cd $testDir
testsimplefilesystem 1
} -constraints [list $dll $loaded testsimplefilesystem] -body {
list [catch {load simplefs:/pkgd$ext PKGD} msg] $msg
list [catch {load simplefs:/pkgd$ext pkgd} msg] $msg
} -result {0 {}} -cleanup {
testsimplefilesystem 0
cd $dir
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testpurebytesobj [llength [info commands testpurebytesobj]]
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
proc failTrace {name1 name2 op} {
error "trace failed"
+42 -40
View File
@@ -11,10 +11,12 @@ namespace eval ::tcl::test::main {
# Is [exec] defined?
testConstraint exec [llength [info commands exec]]
# Is the tcl::test package loaded?
testConstraint tcl::test [expr {
[llength [package provide tcl::test]]
&& [package vsatisfies [package provide tcl::test] 8.5-]}]
# Is the Tcltest package loaded?
# - that is, the special C-coded testing commands in tclTest.c
# - tests use testing commands introduced in Tcltest 8.4
testConstraint Tcltest [expr {
[llength [package provide Tcltest]]
&& [package vsatisfies [package provide Tcltest] 8.5-]}]
# Procedure to simulate interactive typing of commands, line by line
proc type {chan script} {
@@ -190,7 +192,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-2.1 {
Tcl_Main: appInitProc returns error
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
makeFile {puts "In script"} script
} -body {
@@ -206,7 +208,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-2.2 {
Tcl_Main: appInitProc returns error
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {puts "In script"} -appinitprocerror >& result
set f [open result]
@@ -219,7 +221,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-2.3 {
Tcl_Main: appInitProc deletes interp
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
makeFile {puts "In script"} script
} -body {
@@ -235,7 +237,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-2.4 {
Tcl_Main: appInitProc deletes interp
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {puts "In script"} \
-appinitprocdeleteinterp >& result
@@ -249,7 +251,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-2.5 {
Tcl_Main: appInitProc closes stderr
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {puts "In script"} \
-appinitprocclosestderr >& result
@@ -334,7 +336,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-3.5 {
Tcl_Main: startup script sets main loop
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
makeFile {
rename exit _exit
@@ -362,7 +364,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-3.6 {
Tcl_Main: startup script sets main loop and closes stdin
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
makeFile {
close stdin
@@ -391,7 +393,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-3.7 {
Tcl_Main: startup script deletes interp
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
makeFile {
rename exit _exit
@@ -415,7 +417,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-3.8 {
Tcl_Main: startup script deletes interp and sets mainloop
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
makeFile {
testsetmainloop
@@ -459,7 +461,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-4.1 {
Tcl_Main: rcFile evaluation deletes interp
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
set rc [makeFile {testinterpdelete {}} rc]
} -body {
@@ -476,7 +478,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-4.2 {
Tcl_Main: rcFile evaluation closes stdin
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
set rc [makeFile {close stdin} rc]
} -body {
@@ -493,7 +495,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-4.3 {
Tcl_Main: rcFile evaluation closes stdin and sets main loop
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
set rc [makeFile {
close stdin
@@ -521,7 +523,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-4.4 {
Tcl_Main: rcFile evaluation sets main loop
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
set rc [makeFile {
testsetmainloop
@@ -548,7 +550,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-4.5 {
Tcl_Main: Bug 1481986
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
set rc [makeFile {
testsetmainloop
@@ -696,7 +698,7 @@ namespace eval ::tcl::test::main {
Tcl_Main: interactive mode: close stdin
-> main loop & [exit] & exit handlers
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
rename exit _exit
@@ -720,7 +722,7 @@ namespace eval ::tcl::test::main {
Tcl_Main: interactive mode: delete interp
-> main loop & exit handlers, but no [exit]
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
rename exit _exit
@@ -743,7 +745,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-5.10 {
Tcl_Main: exit main loop in mid-interactive command
} -constraints {
exec tcl::test
exec Tcltest
} -setup {
catch {set f [open "|[list [interpreter]]" w+]}
catch {chan configure $f -blocking 0}
@@ -764,7 +766,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-5.11 {
Tcl_Main: EOF in interactive main loop
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
rename exit _exit
@@ -786,7 +788,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-5.12 {
Tcl_Main: close stdin in interactive main loop
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
rename exit _exit
@@ -839,7 +841,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-6.2 {
Tcl_Main: prompt deletes interp
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
set tcl_prompt1 {testinterpdelete {}}
@@ -891,7 +893,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-6.5 {
Tcl_Main: interactive entry to main loop
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
set tcl_interactive 1
@@ -941,7 +943,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-7.1 {
Tcl_Main: [exit] defined as no-op -> still have exithandlers
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
proc exit args {}
@@ -957,7 +959,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-7.2 {
Tcl_Main: [exit] defined as no-op -> still have exithandlers
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
proc exit args {}
@@ -977,7 +979,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.1 {
StdinProc: handles non-blocking stdin
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -994,7 +996,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.2 {
StdinProc: handles stdin EOF
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -1016,7 +1018,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.3 {
StdinProc: handles interactive stdin EOF
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -1037,7 +1039,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.4 {
StdinProc: handles stdin close
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -1060,7 +1062,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.5 {
StdinProc: handles interactive stdin close
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -1084,7 +1086,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.6 {
StdinProc: handles event loop re-entry
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -1103,7 +1105,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.7 {
StdinProc: handling of errors
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -1120,7 +1122,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.8 {
StdinProc: handling of errors, closed stderr
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -1138,7 +1140,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.9 {
StdinProc: interactive output
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -1154,7 +1156,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.10 {
StdinProc: interactive output, closed stdout
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -1172,7 +1174,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.11 {
StdinProc: prompt deletes interp
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -1188,7 +1190,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.12 {
StdinProc: prompt closes stdin
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << {
testsetmainloop
@@ -1207,7 +1209,7 @@ namespace eval ::tcl::test::main {
test Tcl_Main-8.13 {
Bug 1775878
} -constraints {
exec tcl::test
exec Tcltest
} -body {
exec [interpreter] << "testsetmainloop\nputs \\\npwd\ntestexitmainloop" >& result
set f [open result]
+1 -1
View File
@@ -18,7 +18,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testhashsystemhash [llength [info commands testhashsystemhash]]
+1 -1
View File
@@ -19,7 +19,7 @@ if {"::tcltest" ni [namespace children]} {
testConstraint memory [llength [info commands memory]]
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
#
# REMARK: the tests for 'namespace upvar' are not done here. They are to be
+1 -1
View File
@@ -19,7 +19,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testevent [llength [info commands testevent]]
+1 -1
View File
@@ -15,7 +15,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testnrelevels [llength [info commands testnrelevels]]
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testobj [llength [info commands testobj]]
testConstraint longIs32bit [expr {$tcl_platform(wordSize) == 4}]
+12 -12
View File
@@ -7,7 +7,7 @@
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
package require tcl::oo 1.0.3
package require TclOO 1.0.3
if {"::tcltest" ni [namespace children]} {
package require tcltest 2.5
namespace import -force ::tcltest::*
@@ -38,14 +38,14 @@ if {[testConstraint memory]} {
test oo-0.1 {basic test of OO's ability to clean up its initial state} {
interp create t
t eval {
package require tcl::oo
package require TclOO
}
interp delete t
} {}
test oo-0.2 {basic test of OO's ability to clean up its initial state} {
set i [interp create]
interp eval $i {
package require tcl::oo
package require TclOO
namespace delete ::
}
interp delete $i
@@ -79,7 +79,7 @@ test oo-0.6 {cleaning the core class pair; way #1} -setup {
interp create t
} -body {
t eval {
package require tcl::oo
package require TclOO
namespace path oo
list [catch {class destroy} m] $m [catch {object destroy} m] $m
}
@@ -90,7 +90,7 @@ test oo-0.7 {cleaning the core class pair; way #2} -setup {
interp create t
} -body {
t eval {
package require tcl::oo
package require TclOO
namespace path oo
list [catch {object destroy} m] $m [catch {class destroy} m] $m
}
@@ -109,10 +109,10 @@ test oo-0.8 {leak in variable management} -setup {
} -cleanup {
foo destroy
} -result 0
test oo-0.9 {various types of presence of the tcl::oo package} {
list [lsearch -nocase -all -inline [package names] tcl::oo] \
[package present tcl::oo] [expr {$::oo::patchlevel in [package versions tcl::oo]}]
} [list tcl::oo $::oo::patchlevel 1]
test oo-0.9 {various types of presence of the TclOO package} {
list [lsearch -nocase -all -inline [package names] tcloo] \
[package present TclOO] [expr {$::oo::patchlevel in [package versions TclOO]}]
} [list TclOO $::oo::patchlevel 1]
test oo-1.1 {basic test of OO functionality: no classes} {
set result {}
@@ -383,7 +383,7 @@ test oo-2.1 {basic test of OO functionality: constructor} -setup {
# we're modifying the root object class's constructor
interp create subinterp
subinterp eval {
package require tcl::oo
package require TclOO
}
} -body {
subinterp eval {
@@ -514,7 +514,7 @@ test oo-3.1 {basic test of OO functionality: destructor} -setup {
# modifying the root object class's constructor
interp create subinterp
subinterp eval {
package require tcl::oo
package require TclOO
}
} -body {
subinterp eval {
@@ -534,7 +534,7 @@ test oo-3.2 {basic test of OO functionality: destructor} -setup {
# we're modifying the root object class's constructor
interp create subinterp
subinterp eval {
package require tcl::oo
package require TclOO
}
} -body {
subinterp eval {
+1 -1
View File
@@ -7,7 +7,7 @@
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
package require tcl::oo 1.0.3
package require TclOO 1.0.3
if {"::tcltest" ni [namespace children]} {
package require tcltest 2.5
namespace import -force ::tcltest::*
+1 -1
View File
@@ -9,7 +9,7 @@
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
package require tcl::oo 1.0.3
package require TclOO 1.0.3
if {"::tcltest" ni [namespace children]} {
package require tcltest 2.5
namespace import -force ::tcltest::*
+4 -4
View File
@@ -18,12 +18,12 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Do all this in a child interp to avoid garbaging the package list
set i [interp create]
tcltest::loadIntoChildInterpreter $i {*}$argv
catch [list load {} tcl::test $i]
catch [list load {} Tcltest $i]
interp eval $i {
namespace import -force ::tcltest::*
#package forget {*}[package names]
@@ -577,7 +577,7 @@ test package-3.44 {Tcl_PkgRequire: exact version matching (1578344)} -setup {
} -result {version conflict for package "demo": have 1.2.3, need exactly 1.2}
test package-3.50 {Tcl_PkgRequire procedure, picking best stable version} -constraints testpreferstable -setup {
interp create child
load {} tcl::test child
load {} Tcltest child
child eval {
testpreferstable
package forget t
@@ -1340,7 +1340,7 @@ proc prefer {args} {
test package-13.0 {package prefer defaults} -body {
prefer
} -result [expr {[string match {*[ab]*} [package provide tcl]] ? "latest" : "stable"}]
} -result [expr {[string match {*[ab]*} [package provide Tcl]] ? "latest" : "stable"}]
test package-13.1 {package prefer defaults} -body {
set ::env(TCL_PKG_PREFER_LATEST) stable ;# value not relevant!
prefer
+3 -3
View File
@@ -17,7 +17,7 @@ namespace eval ::tcl::test::parse {
namespace import ::tcltest::*
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testparser [llength [info commands testparser]]
testConstraint testbytestring [llength [info commands testbytestring]]
@@ -1051,7 +1051,7 @@ test parse-19.1 {Bug 1115904: recursion limit in Tcl_EvalEx} -constraints {
testevalex
} -setup {
interp create i
load {} tcl::test i
load {} Tcltest i
i eval {proc {} args {}}
interp recursionlimit i 3
} -body {
@@ -1064,7 +1064,7 @@ test parse-19.2 {Bug 1115904: recursion limit in Tcl_EvalEx} -constraints {
testevalex
} -setup {
interp create i
load {} tcl::test i
load {} Tcltest i
i eval {proc {} args {}}
interp recursionlimit i 2
} -body {
+9 -1
View File
@@ -14,7 +14,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Note that the Tcl expression parser (tclCompExpr.c) does not check
# the semantic validity of the expressions it parses. It does not check,
@@ -1075,6 +1075,14 @@ test parseExpr-22.21 {Bug d2ffcca163} -constraints testexprparser -body {
testexprparser in\u0433(0) -1
} -returnCodes error -match glob -result {missing operand*}
test parseExpr-23.1 {TIP 582: comments} -constraints testexprparser -body {
testexprparser "7 # * 8 " -1
} -result {- {} 0 subexpr 7 1 text 7 0 {}}
test parseExpr-23.2 {TIP 582: comments} -constraints testexprparser -body {
testexprparser "7 #\n* 8 " -1
} -result {- {} 0 subexpr {7 #
*} 5 operator # 0 subexpr 7 1 text 7 0 subexpr * 1 text * 0 {}}
# cleanup
cleanupTests
return
+1 -1
View File
@@ -19,7 +19,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testwordend [llength [info commands testwordend]]
testConstraint testbytestring [llength [info commands testbytestring]]
+3 -3
View File
@@ -559,8 +559,8 @@ testConstraint $dll [file exists $x]
if {[testConstraint $dll]} {
makeFile {
# This package provides pkga, which is also provided by a DLL.
package provide pkga 1.0
# This package provides Pkga, which is also provided by a DLL.
package provide Pkga 1.0
proc pkga_neq { x } {
return [expr {! [pkgq_eq $x]}]
}
@@ -576,7 +576,7 @@ test pkgMkIndex-10.1 {package in DLL and script} [list exec $dll] {
set cmd [list pkg_mkIndex -lazy $fullPkgPath [file tail $x] pkga.tcl]
exec [interpreter] << $cmd
pkgtest::runCreatedIndex {0 {}} -lazy $fullPkgPath pkga[info sharedlibextension] pkga.tcl
} "0 {{pkga:1.0 {tclPkgSetup {pkga[info sharedlibextension] load {pkga_eq pkga_quote}} {pkga.tcl source pkga_neq}}}}"
} "0 {{Pkga:1.0 {tclPkgSetup {pkga[info sharedlibextension] load {pkga_eq pkga_quote}} {pkga.tcl source pkga_neq}}}}"
test pkgMkIndex-10.2 {package in DLL hidden by -load} [list exec $dll] {
# Do all [load]ing of shared libraries in another process, so we can
# delete the file and not get stuck because we're holding a reference to
+1 -1
View File
@@ -21,7 +21,7 @@ namespace eval ::tcl::test::platform {
namespace upvar :: tcl_platform tcl_platform
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
package require tcltests
testConstraint testCPUID [llength [info commands testcpuid]]
+20 -20
View File
@@ -18,7 +18,7 @@ if {"::tcltest" ni [namespace children]} {
namespace import -force ::tcltest::*
}
testConstraint tcl::test [expr {![catch {package require tcl::test}]}]
testConstraint procbodytest [expr {![catch {package require procbodytest}]}]
testConstraint memory [llength [info commands memory]]
catch {namespace delete {*}[namespace children :: test_ns_*]}
@@ -210,14 +210,14 @@ catch {rename p ""}
catch {rename t ""}
# Note that the test require that procedures whose body is used to create
# procbody objects must be executed before the tcl::procbodytest::proc command is
# procbody objects must be executed before the procbodytest::proc command is
# executed, so that the Proc struct is populated correctly (CompiledLocals are
# added at compile time).
test proc-4.1 {TclCreateProc, procbody obj} -constraints tcl::test -body {
test proc-4.1 {TclCreateProc, procbody obj} -constraints procbodytest -body {
proc p x {return "$x:$x"}
set rv [p P]
tcl::procbodytest::proc t x p
procbodytest::proc t x p
lappend rv [t T]
} -cleanup {
catch {rename p ""}
@@ -229,9 +229,9 @@ test proc-4.2 {TclCreateProc, procbody obj, use compiled locals} -body {
return "$x:$y"
}
set rv [p P]
tcl::procbodytest::proc t x p
procbodytest::proc t x p
lappend rv [t T]
} -constraints tcl::test -cleanup {
} -constraints procbodytest -cleanup {
catch {rename p ""}
catch {rename t ""}
} -result {P:p T:t}
@@ -241,9 +241,9 @@ test proc-4.3 {TclCreateProc, procbody obj, too many args} -body {
return "$x:$y"
}
set rv [p P]
tcl::procbodytest::proc t {x x1 x2} p
procbodytest::proc t {x x1 x2} p
lappend rv [t T]
} -constraints tcl::test -returnCodes error -cleanup {
} -constraints procbodytest -returnCodes error -cleanup {
catch {rename p ""}
catch {rename t ""}
} -result {procedure "t": arg list contains 3 entries, precompiled header expects 1}
@@ -254,9 +254,9 @@ test proc-4.4 {TclCreateProc, procbody obj, inconsistent arg name} -body {
return "$v:$w"
}
set rv [p P Q R]
tcl::procbodytest::proc t {x x1 z} p
procbodytest::proc t {x x1 z} p
lappend rv [t S T U]
} -constraints tcl::test -returnCodes error -cleanup {
} -constraints procbodytest -returnCodes error -cleanup {
catch {rename p ""}
catch {rename t ""}
} -result {procedure "t": formal parameter 1 is inconsistent with precompiled body}
@@ -267,9 +267,9 @@ test proc-4.5 {TclCreateProc, procbody obj, inconsistent arg default type} -body
return "$v:$w"
}
set rv [p P Q R]
tcl::procbodytest::proc t {x y z} p
procbodytest::proc t {x y z} p
lappend rv [t S T U]
} -constraints tcl::test -returnCodes error -cleanup {
} -constraints procbodytest -returnCodes error -cleanup {
catch {rename p ""}
catch {rename t ""}
} -result {procedure "t": formal parameter 2 is inconsistent with precompiled body}
@@ -280,9 +280,9 @@ test proc-4.6 {TclCreateProc, procbody obj, inconsistent arg default type} -body
return "$v:$w"
}
set rv [p P Q R]
tcl::procbodytest::proc t {x y {z Z}} p
procbodytest::proc t {x y {z Z}} p
lappend rv [t S T U]
} -returnCodes error -constraints tcl::test -cleanup {
} -returnCodes error -constraints procbodytest -cleanup {
catch {rename p ""}
catch {rename t ""}
} -result {procedure "t": formal parameter 2 is inconsistent with precompiled body}
@@ -293,9 +293,9 @@ test proc-4.7 {TclCreateProc, procbody obj, inconsistent arg default value} -bod
return "$v:$w"
}
set rv [p P Q R]
tcl::procbodytest::proc t {x y {z ZZ}} p
procbodytest::proc t {x y {z ZZ}} p
lappend rv [t S T U]
} -constraints tcl::test -returnCodes error -cleanup {
} -constraints procbodytest -returnCodes error -cleanup {
catch {rename p ""}
catch {rename t ""}
} -result {procedure "t": formal parameter "z" has default value inconsistent with precompiled body}
@@ -309,10 +309,10 @@ test proc-4.8 {TclCreateProc, procbody obj, no leak on multiple iterations} -set
return "$x:$y"
}
px x
} -constraints {tcl::test memory} -body {
} -constraints {procbodytest memory} -body {
set end [getbytes]
for {set i 0} {$i < 5} {incr i} {
tcl::procbodytest::proc tx x px
procbodytest::proc tx x px
set tmp $end
set end [getbytes]
}
@@ -321,8 +321,8 @@ test proc-4.8 {TclCreateProc, procbody obj, no leak on multiple iterations} -set
rename getbytes {}
unset -nocomplain end i tmp leakedBytes
} -result 0
test proc-4.9 {[39fed4dae5] Valid Tcl_PkgPresent return} tcl::test {
tcl::procbodytest::check
test proc-4.9 {[39fed4dae5] Valid Tcl_PkgPresent return} procbodytest {
procbodytest::check
} 1
test proc-5.1 {Bytecompiling noop; test for correct argument substitution} -body {
+1 -1
View File
@@ -15,7 +15,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# All tests require the testregexp command, return if this
# command doesn't exist
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testdel [llength [info commands testdel]]
+1 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testinterpresolver [llength [info commands testinterpresolver]]
+1 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Some tests require the testsaveresult command
+5 -3
View File
@@ -13,6 +13,8 @@
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
package require Tcl 8.5-
if {"::tcltest" ni [namespace children]} {
package require tcltest 2.5
namespace import -force ::tcltest::*
@@ -51,10 +53,10 @@ proc mapAndSortList {map listIn} {
# thus un-autoindexed) APIs in this test result arguments:
catch {safe::interpConfigure}
# testing that nested and statics do what is advertised (we use a
# package - tcl::test - but it might be absent if we're in standard tclsh)
# testing that nested and statics do what is advertised (we use a static
# package - Tcltest - but it might be absent if we're in standard tclsh)
testConstraint tcl::test [expr {![catch {package require tcl::test}]}]
testConstraint TcltestPackage [expr {![catch {package require Tcltest}]}]
# Tests 5.* test the example files before using them to test safe interpreters.
+8 -8
View File
@@ -54,9 +54,9 @@ proc mapAndSortList {map listIn} {
catch {safe::interpConfigure}
# testing that nested and statics do what is advertised (we use a static
# package - tcl::test - but it might be absent if we're in standard tclsh)
# package - Tcltest - but it might be absent if we're in standard tclsh)
testConstraint tcl::test [expr {![catch {package require tcl::test}]}]
testConstraint TcltestPackage [expr {![catch {package require Tcltest}]}]
test safe-1.1 {safe::interpConfigure syntax} -returnCodes error -body {
safe::interpConfigure
@@ -1158,14 +1158,14 @@ test safe-9.24 {interpConfigure change the access path; check module loading; st
# See comments on lsort after test safe-9.20.
catch {teststaticpkg Safepkg1 0 0}
test safe-10.1 {testing statics loading} -constraints tcl::test -setup {
test safe-10.1 {testing statics loading} -constraints TcltestPackage -setup {
set i [safe::interpCreate]
} -body {
interp eval $i {load {} Safepkg1}
} -returnCodes error -cleanup {
safe::interpDelete $i
} -result {load of binary library for package Safepkg1 failed: can't use package in a safe interpreter: no Safepkg1_SafeInit procedure}
test safe-10.1.1 {testing statics loading} -constraints tcl::test -setup {
test safe-10.1.1 {testing statics loading} -constraints TcltestPackage -setup {
set i [safe::interpCreate]
} -body {
catch {interp eval $i {load {} Safepkg1}} m o
@@ -1178,7 +1178,7 @@ test safe-10.1.1 {testing statics loading} -constraints tcl::test -setup {
"load {} Safepkg1"
invoked from within
"interp eval $i {load {} Safepkg1}"}
test safe-10.2 {testing statics loading / -nostatics} -constraints tcl::test -body {
test safe-10.2 {testing statics loading / -nostatics} -constraints TcltestPackage -body {
set i [safe::interpCreate -nostatics]
interp eval $i {load {} Safepkg1}
} -returnCodes error -cleanup {
@@ -1186,18 +1186,18 @@ test safe-10.2 {testing statics loading / -nostatics} -constraints tcl::test -bo
} -result {permission denied (static package)}
test safe-10.3 {testing nested statics loading / no nested by default} -setup {
set i [safe::interpCreate]
} -constraints tcl::test -body {
} -constraints TcltestPackage -body {
interp eval $i {interp create x; load {} Safepkg1 x}
} -returnCodes error -cleanup {
safe::interpDelete $i
} -result {permission denied (nested load)}
test safe-10.4 {testing nested statics loading / -nestedloadok} -constraints tcl::test -body {
test safe-10.4 {testing nested statics loading / -nestedloadok} -constraints TcltestPackage -body {
set i [safe::interpCreate -nestedloadok]
interp eval $i {interp create x; load {} Safepkg1 x}
} -returnCodes error -cleanup {
safe::interpDelete $i
} -result {load of binary library for package Safepkg1 failed: can't use package in a safe interpreter: no Safepkg1_SafeInit procedure}
test safe-10.4.1 {testing nested statics loading / -nestedloadok} -constraints tcl::test -body {
test safe-10.4.1 {testing nested statics loading / -nestedloadok} -constraints TcltestPackage -body {
set i [safe::interpCreate -nestedloadok]
catch {interp eval $i {interp create x; load {} Safepkg1 x}} m o
dict get $o -errorinfo
+1 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testset2 [llength [info commands testset2]]
+1 -1
View File
@@ -66,7 +66,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
::tcltest::loadTestedCommands
if {[info exists ::env(TRAVIS_OSX_IMAGE)] && [string match xcode* $::env(TRAVIS_OSX_IMAGE)]} {
+1 -1
View File
@@ -18,7 +18,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Helper commands to test various optimizations, code paths, and special cases.
proc makeByteArray {s} {binary format a* $s}
+1 -1
View File
@@ -18,7 +18,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testobj [llength [info commands testobj]]
testConstraint testbytestring [llength [info commands testbytestring]]
+1 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
namespace import -force ::tcltest::*
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testbytestring [llength [info commands testbytestring]]
+1 -1
View File
@@ -15,7 +15,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testnrelevels [llength [info commands testnrelevels]]
+1 -1
View File
@@ -20,7 +20,7 @@ if {"::tcltest" ni [namespace children]} {
# be fully finalized, which avoids valgrind "still reachable" reports.
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
package require tcltests
# Some tests require the testthread command
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testcmdtrace [llength [info commands testcmdtrace]]
testConstraint testevalobjv [llength [info commands testevalobjv]]
+1 -1
View File
@@ -15,7 +15,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testchmod [llength [info commands testchmod]]
+1 -1
View File
@@ -15,7 +15,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testfindexecutable [llength [info commands testfindexecutable]]
+10 -13
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Figure out what extension is used for shared libraries on this
# platform.
@@ -38,9 +38,6 @@ testConstraint $loaded [expr {![string match *pkgua* $alreadyLoaded]}]
set alreadyTotalLoaded [info loaded]
# Certain tests require the 'teststaticpkg' command from tcltest
testConstraint teststaticpkg [llength [info commands teststaticpkg]]
# Certain tests need the 'testsimplefilsystem' in tcltest
testConstraint testsimplefilesystem \
[llength [info commands testsimplefilesystem]]
@@ -135,17 +132,17 @@ child eval {
set pkgua_detached {}
set pkgua_unloaded {}
}
test unload-3.1 {basic loading of non-unloadable package in a safe interpreter} \
test unload-3.1 {basic loading of non-unloadable package in a safe interpreter, with package name conversion} \
[list $dll $loaded] {
catch {rename pkgb_sub {}}
load [file join $testDir pkgb$ext] Pkgb child
load [file join $testDir pkgb$ext] pKgB child
list [child eval pkgb_sub 44 13] [catch {child eval pkgb_unsafe} msg] $msg \
[catch {pkgb_sub 12 10} msg2] $msg2
} {31 1 {invalid command name "pkgb_unsafe"} 1 {invalid command name "pkgb_sub"}}
test unload-3.2 {basic loading of unloadable package in a safe interpreter} \
test unload-3.2 {basic loading of unloadable package in a safe interpreter, with package name conversion} \
[list $dll $loaded] {
list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \
[load [file join $testDir pkgua$ext] pkgua child] \
[load [file join $testDir pkgua$ext] pKgUA child] \
[child eval pkgua_eq abc def] \
[lsort [child eval info commands pkgua_*]] \
[child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}]
@@ -157,7 +154,7 @@ test unload-3.3 {unloading of a package that has never been loaded from a safe i
} -result {file "*" has never been loaded in this interpreter}
test unload-3.4 {basic unloading of a non-unloadable package from a safe interpreter, with guess for package name} -setup {
if {[lsearch -index 1 [info loaded child] Pkgb] < 0} {
load [file join $testDir pkgb$ext] Pkgb child
load [file join $testDir pkgb$ext] pKgB child
}
} -constraints [list $dll $loaded] -returnCodes error -match glob -body {
unload [file join $testDir pkgb$ext] {} child
@@ -218,7 +215,7 @@ test unload-4.1 {loading of unloadable package in trusted interpreter, with gues
[list $pkgua_loaded $pkgua_detached $pkgua_unloaded]
} -result {{{} {} {}} {} 0 {pkgua_eq pkgua_quote} {. {} {}}}
## Load package in child-safe interpreter...
test unload-4.2 {basic loading of unloadable package in a safe interpreter} -setup {
test unload-4.2 {basic loading of unloadable package in a safe interpreter, with package name conversion} -setup {
child eval {
set pkgua_loaded ""
set pkgua_detached ""
@@ -227,17 +224,17 @@ test unload-4.2 {basic loading of unloadable package in a safe interpreter} -set
incr load(C)
} -constraints [list $dll $loaded] -body {
list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \
[load [file join $testDir pkgua$ext] pkgua child] \
[load [file join $testDir pkgua$ext] pKgUA child] \
[child eval pkgua_eq abc def] \
[lsort [child eval info commands pkgua_*]] \
[child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}]
} -result {{{} {} {}} {} 0 {pkgua_eq pkgua_quote} {. {} {}}}
## Load package in child-trusted interpreter...
test unload-4.3 {basic loading of unloadable package in a second trusted interpreter} -setup {
test unload-4.3 {basic loading of unloadable package in a second trusted interpreter, with package name conversion} -setup {
incr load(T)
} -constraints [list $dll $loaded] -body {
list [child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \
[load [file join $testDir pkgua$ext] pkgua child-trusted] \
[load [file join $testDir pkgua$ext] pkguA child-trusted] \
[child-trusted eval pkgua_eq abc def] \
[lsort [child-trusted eval info commands pkgua_*]] \
[child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}]
+1 -1
View File
@@ -17,7 +17,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testupvar [llength [info commands testupvar]]
+1 -1
View File
@@ -14,7 +14,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint ucs2 [expr {[format %c 0x010000] eq "\uFFFD"}]
testConstraint fullutf [expr {[format %c 0x010000] ne "\uFFFD"}]
+1 -1
View File
@@ -13,7 +13,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint controversialNaN 1
testConstraint testbytestring [llength [info commands testbytestring]]
+1 -1
View File
@@ -20,7 +20,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testupvar [llength [info commands testupvar]]
testConstraint testgetvarfullname [llength [info commands testgetvarfullname]]
+2 -2
View File
@@ -20,7 +20,7 @@ if {[testConstraint win]} {
if {![catch {
::tcltest::loadTestedCommands
set ::ddever [package require dde 1.4.3]
set ::ddelib [lindex [package ifneeded dde $::ddever] 1]}]} {
set ::ddelib [info loaded "" Dde]}]} {
testConstraint dde 1
}
}
@@ -38,7 +38,7 @@ proc createChildProcess {ddeServerName args} {
set f [open $::scriptName w+]
puts $f [list set ddeServerName $ddeServerName]
puts $f [list load $::ddelib dde]
puts $f [list load $::ddelib Dde]
puts $f {
# DDE child server -
#
+1 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
# Initialise the test constraints
+1 -1
View File
@@ -16,7 +16,7 @@ if {"::tcltest" ni [namespace children]} {
}
::tcltest::loadTestedCommands
catch [list package require -exact tcl::test [info patchlevel]]
catch [list package require -exact Tcltest [info patchlevel]]
testConstraint testvolumetype [llength [info commands testvolumetype]]
testConstraint notNTFS 0

Some files were not shown because too many files have changed in this diff Show More