Running Tests

There are two ways to execute a test suite. The most common way is when there is existing support in the Makefile. This support consists of a check target. The other way is to execute the runtest program directly. To run runtest directcly from the command line requires either all the correct options, or the Local Config File must be setup correctly.

Make check

To run tests from an existing collection, first use configure as usual to set up the build directory. Then try typing:

      make check
      

If the 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. The most common file the check builds is the site.exp. The site.exp file contains various variables that DejaGnu used to dertermine the configuration of the program being tested. This is mostly for supporting remote testing.

The check target is supported by GNU Automake. To have DejaGnu support added to your generated Makefile.in, just add the keyword dejagnu to the AUTOMAKE_OPTIONS variable in your Makefile.am file.

Once you have run make check to build any auxiliary files, you can invoke the test driver runtest directly to repeat the tests. You will also have to execute runtest directly for test collections with no check target in the Makefile.