To run tests from an existing collection, first use
usual to set up the source directory containing the tests. Then try
check target exists, it usually saves you some
trouble--for instance, it can set up any auxiliary programs or other
files needed by the tests.
Once you have run `make check' to build any auxiliary files, you
might want to call the test driver
runtest directly to repeat the
tests. You may also have to call
runtest directly for test
collections with no
check target in the `Makefile'.
Typically, you must use two command-line options: `--tool', to specify which set of tests to run(1), and `--srcdir', to specify where to find test directories.
For example, if the directory `gdb/testsuite' contains a collection of DejaGnu tests for GDB, you can run them like this:
eg$ cd gdb/testsuite eg$ runtest --tool gdb Test output follows, ending with: === gdb Summary === # of expected passes 508 # of expected failures 103 /usr/latest/bin/gdb version 4.14.4 -nx
You can use the option `--srcdir' to point to some other directory containing a collection of tests:
eg$ runtest --tool gdb --srcdir /devo/gdb/testsuite
These examples assume a native configuration, where the same
computer runs both
runtest and the tests themselves. When you
have a cross configuration, the tests run on a different computer,
controlled by the host running
runtest. In this situation, you
need the option `--name' to specify the network address for the
eg$ runtest --tool gdb --name vx9.munist.com
If you always use the same option values, you can record them in a file called `site.exp', rather than typing them each time. See section Config Variables.
runtest prints only the names of the tests it runs,
output from any tests that have unexpected results, and a summary
showing how many tests passed and how many failed. To display output
from all tests (whether or not they behave as expected), use the
`--all' option. For more verbose output about processes being run,
communication, and so on, use `--verbose'. To see even more output,
use multiple `--verbose' options. See section Using
runtest, for a more detailed explanation of each
Test output goes into two files in your current directory: summary output in `tool.sum', and detailed output in `tool.log'. (tool refers to the collection of tests; for example, after a run with `--tool gdb', look for output files `gdb.sum' and `gdb.log'.) See section The files DejaGnu writes.
Go to the first, previous, next, last section, table of contents.