Skip to content
Tcl Source Code View Ticket
Login

View Ticket

core file outside of test can cause error

Closed / Fixed833637ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2003-10-31 13:59:33
The tcltest suite fails in particular circumstances due
to the fact that on about line 2477 of tcltest.tcl
inside the cleanupTest proc, there is a reference to
the $name variable which is not set anywhere within
that proc.

Example:

@ashland [~/workshop/tsttest] $ tclsh runall.tcl
-singleproc 1
Running with standard tcltest
Tests running in interp:  /usr/bin/tclsh
Tests located in:  /home/davidw/workshop/tsttest
Tests running in:  /home/davidw/workshop/tsttest
Temporary files stored in /home/davidw/workshop/tsttest
Test files sourced into current interpreter
Running tests that match:  *
Skipping test files that match:  l.*.test
Only running test files that match:  cleanupcore.test
Tests began at Fri Oct 31 02:52:45 PM CET 2003
cleanupcore.test
>>>>>>>>>>>false

Tests ended at Fri Oct 31 02:52:45 PM CET 2003
runall.tcl:     Total   1       Passed  1       Skipped
0       Failed  0
Sourced 1 Test Files.
rename core file (> 1)
can't read "name": no such variable
    while executing
"file join [temporaryDirectory] core-$name"
    (procedure "::tcltest::cleanupTests" line 169)
    invoked from within
"::tcltest::cleanupTests"
    (file "runall.tcl" line 39)

Files attached to recreate the bug.

Hopefully I can whack this bug myself but some
assistance will probably be required to figure out what
should be happening.
davidwplain2003-10-31 20:59:34
File Added - 66035: cleanupcore.test
davidwplain2003-11-01 04:18:36
File Added - 66075: runall.tcl

Logged In: YES 
user_id=240

Here is the runall.tcl bit... it's pretty simple.
dgpplain2003-11-01 04:34:42
Logged In: YES 
user_id=80530


I'm seeing [runAllTests] fail to return;
can you confirm?
dgpplain2003-11-01 04:47:25
Logged In: YES 
user_id=80530


no, it doesn't fail to return after all, 
it just takes a loooonnnnnnnggggg
time becuse [GetMatchingDirectories]
scans the entire filesystem tree below
[testsDirectory].

Anyone else testing for this bug be
warned - do your testing in a directory
without subdirectories.
dgpplain2003-11-01 05:11:34
Logged In: YES 
user_id=80530


Appears that the original bug
dates back to tcltest version 1.
dgp Ticket [833637ffff]: 1 change [History diff]2003-11-13 08:00:30
dgpplain2004-02-04 13:09:30
Logged In: YES 
user_id=80530


This bug was introduced
in revision 1.5, before even
version tcltest 1.0 was
released (with Tcl 8.2).

It appears that code was
copy/paste/modified from
[test] (where $name is
an argument) to [cleanupTests]
(where there is no $name).

Committing fix where $name
in cleanupTests is changed to
$testFileName, which seems
to be the appropriate analog.
dgp Ticket [833637ffff]: 2 changes [History diff]2004-02-04 13:09:33
Log in (anonymous is fine) to add a comment.

Attachments: