Re: want to redefine tcltest to add database updates



dwechsler wrote:
After recently learning that I can redefine any command, I was
thinking about redefining the test command from tcltest so it can
parse the initial description string and add it to a database. I'd
like it to also somehow look at the results of the tests to get pass/
fail status that I can also add.

If that's all that you want, you might consider simply adding an execution trace on the test command. The way it works is this: every time the test command runs, a proc of your choosing will get called. You can choose for it to run either immediately before or immediately after the test command runs. You'll be given the whole command line and other useful bits depending on when your command is run.

http://www.tcl.tk/man/tcl8.4/TclCmd/trace.htm#M9

Arguably, that is a little less fraught with peril than redefining test, though redefining test is a perfectly fine idea if you want more control.


--
Bryan Oakley
http://www.tclscripting.com
.



Relevant Pages

  • tcl C API and UTF-8 problems...
    ... I created a small test command in C which mainly receives a string and prints the decimal value of it. ... int testCommand (ClientData clientData, Tcl_Interp* interp, int argc, ...
    (comp.lang.tcl)
  • Re: lsearch man page
    ... The list element must contain exactly the same string as pattern. ... and I have to type a few test command to check the behaviour of the command. ... if you have a bucket with 2 liters of water in it, ...
    (comp.lang.tcl)
  • Re: help with shell scripting!!
    ... # I am new to shell programming, I want to do a string comparison, I am ... which write ' full of errors' to stdout and then insert stdout into the string ... You need to give arguments the test command will recognises, ...
    (comp.unix.programmer)
  • want to redefine tcltest to add database updates
    ... After recently learning that I can redefine any command, ... thinking about redefining the test command from tcltest so it can ... parse the initial description string and add it to a database. ...
    (comp.lang.tcl)