better -loadfile sharing
Closed / Rejected577038ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-07-03 16:12:28
[loadTestedCommands] is to be used to load in the commands to be tested, as specified by -load or -loadfile. However, in a multi-file test suite, each file must be able to run as a self-contained script to satisfy the [configure -singleproc false] operations. This means that the file or script to be shared among all files must be named in all files. This means that the whole [loadTestedCommands] machinery is hardly better than the traditional [source defs.tcl] ever was. A better scheme is needed to be able to share common code among many test files in a test suite.
andreas_kupriesplain2002-07-03 23:19:06
Logged In: YES user_id=75003 I believe the -singleproc stuff came after [loadTestedCommands] was invented, so in the beginning it was better. Currently have no idea for a better scheme tough.
dgp Ticket [577038ffff]: 1 change
[History diff]2002-07-07 01:01:58
dgpplain2003-02-05 05:08:02
Logged In: YES
user_id=80530
I've looked at this again recently, and
the status quo might not be as bad as
I thought, given certain usage patterns.
If one has a multi-file test suite, and
defines the [configure -loadfile] in the
all.tcl file of that test suite, then in each
*.test file calls [loadTestedCommands].
This allows the file containing common
code to be defined in only one place
(the all.tcl file). This will work with any
value of the -singleproc option.
The restriction is that if one wants to run
only one *.test file of the multi-file test suite,
the right way to do that is with the "-file"
command line option:
tclsh all.tcl -file chosenFile.test
Attempting to directly evaluate the test file,
tclsh chosenFile.test
will fail because the all.tcl file is never
evaluated to define the loadFile.
So, as long as a particular set of habits
are maintained, the existing -load*
options work fine.
dgpplain2003-04-02 02:33:47
Logged In: YES user_id=80530 I've addressed this issue with improved instructions in tcl/tests/README.
Log in (anonymous is fine) to add a comment.