Documenting test script arguments and revising runtest_file_p

Jacob Bachmeyer <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
The recent questions about adding a test case led to my asking "How are 
test script arguments passed in DejaGnu?" and finding not only that the 
mechanism is not documented, but that it is another "surprise" 
variable:  runtests.

This mechanism is probably older than Tcl's [info script] command, 
explaining the presence of the test script name in $runtests, but now I 
ask whether this should be changed or documented as it currently is.  I 
suppose that "runtests" could be considered the test script's "argv", 
but want to be clear if this what we really want to maintain long-term, 
especially with its "odd" structure of { ARGV0 
{REST-OF-ARGV-IN-ONE-INNER-LIST} } with an ARGV0 that (in modern Tcl) 
duplicates [file tail [info script]].

Also, runtest_file_p tries to hide the structure of runtests, but should 
also implicitly use it, instead of requiring that it be passed as an 
argument.  I propose that runtest_file_p's argument list should be 
changed to { testlist {testcase {}} } and that runtest_file_p should use 
the runtests global itself if called with only one argument.  This would 
also allow for the "runtests" global, having long been an internal 
detail, to eventually be deprecated and moved into a namespace with 
other DejaGnu internals, leaving a backwards compatibility shim that 
will be removed in 2.0.


-- Jacob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.