### 2.1 Running ’make check’ ¶

To run tests from an existing collection, first use `configure` as usual to set up the build directory. Then type `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 target depends on is the `site.exp` file. The `site.exp` contains various variables that DejaGnu uses to determine the configuration of the program being tested.

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`.

GNU Automake has built-in support for DejaGnu. To add DejaGnu support to your generated `Makefile.in`, just add the keyword `dejagnu` to the AUTOMAKE_OPTIONS variable in `Makefile.am`. This will ensure that the generated `Makefile.in` has a `check` target that invokes DejaGnu correctly. See DejaGnu Tests in The GNU Automake Manual.