[singleProcess 1] and singleTestInterp
Closed / Fixed461000ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 24 years ago
Descriptionplain2001-09-12 20:13:32
$ configure --disable-shared
$ make tcltest
$ cat twotest.tcl
package require tcltest
tcltest::matchFiles [list msgcat.test tcltest.test]
source ./../tests/all.tcl
$ ./tcltest twotest.tcl -singleProc 1
Tests running in interp:
/local/src/tcl/solaris/tcltest
Tests located in: /local/src/tcl/tests
Tests running in: /local/src/tcl/solaris
Temporary files stored in /local/src/tcl/solaris
Test files run in separate interpreters
Only running test files that match: msgcat.test
tcltest.test
Tests began at Wed Sep 12 16:08:36 EDT 2001
msgcat.test
tcltest.test
Tests ended at Wed Sep 12 16:09:18 EDT 2001
all.tcl: Total 166 Passed 164 Skipped
2 Failed 0
Sourced 2 Test Files.
Number of tests skipped for each constraint:
2 LANGisC
$ ./tcltest
% package require tcltest
2.0.1
% tcltest::singleProcess 1
1
% source twotest.tcl
Tests running in interp:
/local/src/tcl/solaris/tcltest
Tests located in: /local/src/tcl/tests
Tests running in: /local/src/tcl/solaris
Temporary files stored in /local/src/tcl/solaris
Test files sourced into current interpreter
Only running test files that match: msgcat.test
tcltest.test
Tests began at Wed Sep 12 16:10:36 EDT 2001
msgcat.test
tcltest.test
==== tcltest-5.5 tcltest::constraintList FAILED
==== Contents of test case:
lsort [tcltest::constraintList]
---- Result was:
95 98 LANGisC asyncPipeClose eformat emptyTest
hasIsoLocale interactive knownBug mac macCrash macOnly
macOrPc macOrUnix macOrWin nonBlockFiles nonPortable
notRoot nt pc pcCrash pcOnly root singleTestInterp
socket stdio tempNotMac tempNotPc tempNotUnix
tempNotWin unix unixCrash unixExecs unixOnly unixOrPc
unixOrWin userInteraction win winCrash winOnly
---- Result should have been (exact matching):
95 98 asyncPipeClose eformat emptyTest hasIsoLocale
interactive knownBug mac macCrash macOnly macOrPc
macOrUnix macOrWin nonBlockFiles nonPortable notRoot nt
pc pcCrash pcOnly root singleTestInterp socket stdio
tempNotMac tempNotPc tempNotUnix tempNotWin unix
unixCrash unixExecs unixOnly unixOrPc unixOrWin
userInteraction win winCrash winOnly
==== tcltest-5.5 FAILED
Tests ended at Wed Sep 12 16:11:15 EDT 2001
all.tcl: Total 166 Passed 163 Skipped
2 Failed 1
Sourced 4 Test Files.
Files with failing tests: tcltest.test
Number of tests skipped for each constraint:
2 LANGisC
Clearly the "-singleProc 1" command line option
successfully clears the singleTestInterp constraint,
but the command [tcltest::singleProcess 1] does not.
hobbs Ticket [461000ffff]: 1 change
[History diff]2002-03-23 06:06:31
dgpplain2002-06-01 06:35:22
Logged In: YES user_id=80530 This is because the [InitConstraints] is called as part of tcltest package initialization, so the "singleTestInterp" constraint is set before the [tcltest::singleProcess] is called, and that call is not changing the constraint. This is another example of the error pointed out in Tcl Patch 512214.
dgpplain2002-06-06 21:43:26
Logged In: YES user_id=80530 grrr..... the option is -singleproc
dgpplain2002-06-06 22:00:08
Logged In: YES user_id=80530 testing with the right command line option reveals that *both* -singleproc *and* [singleProcess] fail to change the singleTestInterp constraint.
dgpplain2002-06-06 22:24:48
Logged In: YES user_id=80530 conversion to lazy initialization of test constraints fixes this. (Patch 512214). Now as long as either the command line options are parsed or [singleProcess] is called before the first use of the singleTestInterp constraint, the right value is used.
Log in (anonymous is fine) to add a comment.