11.5. Adding a Test Suite
Automake has very flexible support for automated test suites within a project distribution, which are discussed more fully in The Automake Manual. I have added a simple shell script–based testing facility to Sic using this support—this kind of testing mechanism is perfectly adequate for command-line projects. The tests themselves just feed prescribed input to the uninstalled sic interpreter and compare the actual output with what is expected.
Here is one of the test scripts:
## -*- sh -*- ## incomplete.test — Test incomplete command handling # Common definitions if test -z "$srcdir"; then srcdir=echo "$0" | sed s,[^/]*$,,' test "$srcdir" = "$0" && srcdir=. test -z "$srcdir" && srcdir=. test "${VERBOSE+set}" != set ...
Get GNU Autoconf, Automake, and Libtool now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.