From: Arjen M. <arj...@wl...> - 2007-04-18 12:29:32
|
Virden, Larry W. wrote: >I definitely think packages like this are valuable. In this particular >case, it would allow us to determine how much of tcllib the tcllib test >suite is testing, just as an example. I suspect this package is only >relevant to testing tcl scripts though, right? > > > Hi Larry, yes, it simply analyses the Tcl code and insert some statements to register that the code has been executed. Some procedures are overloaded to load the instrumented code and to save the results. Things it does not handle well are statements like: if { $cond } continue as there you have the conditional statement (if) and a branching statement (continue) on the same line. It would work if you did: if { $cond } { continue } as then it can simply insert a few lines. (That is much easier than inserting the statements in the right place - the analysis is much more complicated then, you would have to do a complete or almost complete analysis of the Tcl code. With the second form it is a mere matter of applying regexp.) You could use the same technique to produce instrumented code written in other languages, but I have not looked into that (at least not in the context of this particular package/application). Regards, Arjen |