Next: Adding a test case to a testsuite, Previous: Writing a test case, Up: Extending DejaGnu
These are the kinds of debugging information available from DejaGnu:
verbose
procedure (which in turn uses the Tcl variable
‘verbose’) to control how much output to generate. This will make
it easier for other people running the test to debug it if necessary.
If ‘verbose’ is zero, there should be no output other than the
output from the framework (eg. FAIL). 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 plenty of debugging
information.
Use --debug
for information from Expect. It logs how Expect
attempts to match the tool output with the patterns specified. This 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.
--strace
to see more detail from Tcl. This logs how Tcl
procedure definitions are expanded as they execute. The trace level
argument controls the depth of definitions expanded.
runtest -v -v
-v
), DejaGnu activates the Expect command log_user
. This
command prints all Expect actions to standard output, to the .log
file and, if --debug
is given, to dbg.log.
Next: Adding a test case to a testsuite, Previous: Writing a test case, Up: Extending DejaGnu