7.7 Testing

back: multiple directories
forward: bootstrapping
fastback: introducing gnu automake
up: introducing gnu automake
fastforward: bootstrapping
top: autoconf, automake, and libtool
contents: table of contents
index: index
about: about this document

Automake also includes simple support for testing your program.

The most simple form of this is the `TESTS' variable. This variable holds a list of tests which are run when the user runs make check . Each test is built (if necessary) and then executed. For each test, make prints a single line indicating whether the test has passed or failed. Failure means exiting with a non-zero status, with the special exception that an exit status of `77' (2) means that the test should be ignored. make check also prints a summary showing the number of passes and fails.

Automake also supports the notion of an xfail , which is a test which is expected to fail. Sometimes this is useful when you want to track a known failure, but you aren't prepared to fix it right away. Tests which are expected to fail should be listed in both `TESTS' and `XFAIL_TESTS' .

The special prefix `check' can be used with primaries to indicate that the objects should only be built at make check time. For example, here is how you can build a program that will only be used during the testing process:

 check_PROGRAMS = test-program test_program_SOURCES = ... 

Automake also supports the use of DejaGNU, the GNU test framework. DejaGNU support can be enabled using the `dejagnu' option:


The resulting `Makefile.in' will include code to invoke the runtest program appropriately.

This document was generated by Gary V. Vaughan on May, 24 2001 using texi2html

GNU Autoconf, Automake and Libtool
GNU Autoconf, Automake, and Libtool
ISBN: 1578701902
EAN: 2147483647
Year: 2002
Pages: 290

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net