Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-06-26
07:20 • Ticket [556837ffff] nested tests are not counted correctly status still Open... artifact: a0146705ef user: dgp
2002-05-21
00:48 • Ticket [556837ffff]: 4 changes artifact: f8968a31c6 user: vincentdarley
00:16 • Ticket [556837ffff]: 5 changes artifact: e2f3f3288f user: dgp
2002-05-16
16:02 • New ticket [556837ffff]. artifact: ff11748b3b user: vincentdarley

nested tests are not counted correctly

Open556837ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 24 years ago
Descriptionplain2002-05-16 16:02:54
If one test executes a number of others, the 'inside' 
tests are not reported in the statistics at the end of 
the test run.

A complex example of this is available in the tclvfs 
test suite (vfsArchive.test)

But a simple example is as follows:

% package require tcltest
% tcltest::test name {blah} { tcltest::test in in 
{expr 1} {0} } {1}


==== in in FAILED
==== Contents of test case:
expr 1
---- Result was:
1
---- Result should have been (exact matching):
0
==== in FAILED


==== name blah FAILED
==== Contents of test case:
 tcltest::test in in {expr 1} {0} 
---- Result was:
0
---- Result should have been (exact matching):
1
==== name FAILED

0

% tcltest::cleanupTests 1
:Total1Passed0Skipped0
Failed1
Sourced 0 Test Files.

But of course this should say 'total 2', 'failed 2'.
dgpplain2002-05-21 00:16:51
Logged In: YES 
user_id=80530

This is one of the KNOWN ISSUES mentioned
in the tcltest 2 documentation.

Can you provide an example -- other than
testing the tcltest package itself -- where
it is useful for a test to run a test?

While it would be nice to overcome this
limitation, I don't see it as a high priority
matter.
vincentdarleyplain2002-05-21 00:48:36
Logged In: YES 
user_id=32170

An example: sure, as mentioned above, this capability is 
used in tclvfs.  Tclvfs contains a fair number of tests of 
the way a given filesystem works, etc.  Of course what you 
really want to do as well is check whether /any/ filesystem 
behaves properly.  So, the way vfsArchive.test does this is 
by creating a .zip archive of the test suite and running 
the tests from within that archive.  Then it creates a 
metakit archive of the suite and runs those, etc.  Each of 
these archive-tests can be considered a 'meta-test' (and is 
implemented as a tcltest::test) but each in turn actually 
causes dozens of other tests to be executed.  This is a 
very natural, clean way of performing this task.

sorry for not reading the 'known issues'...
dgpplain2002-06-26 07:20:40
Logged In: YES 
user_id=80530


I took a brief look at vfsArchive.test.  Is that something
one could do with slave interpreters?  That might
be a way to work around this deficiency in tcltest.
Log in (anonymous is fine) to add a comment.