dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Documenting test script arguments and revising runtest_file_p


From: Jacob Bachmeyer
Subject: Documenting test script arguments and revising runtest_file_p
Date: Fri, 11 Jan 2019 19:02:09 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]