manpagez: man pages & more
info dejagnu
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2 Debugging a test case

These are the kinds of debugging information available from DejaGnu:

  1. Output controlled by test scripts themselves, explicitly allowed for by the test author. This kind of debugging output appears in the detailed output recorded in the ‘tool.log’ file. To do the same for new tests, use the verbose procedure (which in turn uses the variable also called verbose) to control how much output to generate. This will make it easier for other people running the test to debug it if necessary. Whenever possible, if ‘$verbose’ is 0, there should be no output other than the output from pass, fail, error, and warning. Then, to whatever extent is appropriate for the particular test, allow successively higher values of ‘$verbose’ to generate more information. Be kind to other programmers who use your tests: provide for a lot of debugging information.
  2. Output from the internal debugging functions of Tcl and expect. There is a command line options for each; both forms of debugging output are recorded in the file dbg.log in the current directory.

    Use ‘--debug’ for information from the expect level; it generates displays of the expect attempts to match the tool output with the patterns specified (see section Debug Log). This output can be very helpful while developing test scripts, since it shows precisely the characters received. Iterating between the latest attempt at a new test script and the corresponding ‘dbg.log’ can allow you to create the final patterns by “cut and paste”. This is sometimes the best way to write a test case.

    Use ‘--strace’ to see more detail at the Tcl level; this shows how Tcl procedure definitions expand, as they execute. The associated number controls the depth of definitions expanded; see the discussion of ‘--strace’ in Running the Tests.

  3. Finally, if the value of ‘verbose’ is 3 or greater, runtest turns on the expect command log_user. This command prints all expect actions to the expect standard output, to the detailed log file, and (if ‘--debug’ is on) to ‘dbg.log’.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© 2000-2021
Individual documents may contain additional copyright information.