Noeud:Running an Autotest Test Suite, Noeud « Next »:Stand-alone Test Suite, Noeud « Previous »:What is Autotest, Noeud « Up »:Software Testing with Autotest
An Autotest test suite is often named testsuite
, but we
advertise for more explicit names, such as test-m4
,
test-joepackage
etc. This way, it can be installed or sent to
other people.
To test a package, such as GNU M4, just run its test suite:
$ cd m4-1.5/tests $ ./testsuite ## ---------------------- ## ## GNU m4 1.5 test suite. ## ## ---------------------- ## Macro definitions. 1: macros.at:29 ok 2: macros.at:71 ok 3: macros.at:105 ok ... Options. 21: options.at:26 ok 22: options.at:52 ok Composite macros. ... Documentation examples. 43: generated.at:14 ok ... 78: generated.at:1404 ok 79: generated.at:1438 ok ## ----------------------------- ## ## All 79 tests were successful. ## ## ----------------------------- ##
All the test groups (here, numbered from 1 to 79) are run. If some failed, a log file would have been created, full of details that might help the GNU M4 maintainer to understand the failure. For instance in the following example, I have manually changed the test group 44 for it to fail:
$ ./testsuite 44 ## ---------------------- ## ## GNU m4 1.5 test suite. ## ## ---------------------- ## 44: generated.at:48 FAILED near `generated.at:60' ## ----------------------------------------------- ## ## ERROR: Suite unsuccessful, 1 of 1 tests failed. ## ## ----------------------------------------------- ## You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Now, failed tests will be executed again, verbosely, and logged in the file testsuite.log. ## ---------------------- ## ## GNU m4 1.5 test suite. ## ## ---------------------- ## 44. generated.at:48: testing Define... generated.at:60: m4 -b -d input.m4 --- - Sat Jan 12 17:31:38 2002 +++ at-stdout Sat Jan 12 17:31:38 2002 @ -1,3 +1,3 @ -Hello world. +Hello universe. 44. generated.at:48: FAILED near `generated.at:60' ## ------------------------- ## ## testsuite.log is created. ## ## ------------------------- ## Please send `testsuite.log' to <bug-m4@gnu.org>, along with all information you think might help.
Autotest test suites support the following arguments:
--list
-l
To change environment variables, set of tests, or verbosity of the test suite:
variable=
value
AUTOTEST_PATH
specifies the testing path to prepend to
PATH
.
number
number-
number
number-
-
number
--keywords=
keywords
-k
keywords
AT_SETUP
or AT_KEYWORDS
, see (FIXME: Test Groups.)) match
all the keywords of the comma separated list keywords.
Running ./testsuite -k autoupdate,FUNC
will select all the tests
tagged with autoupdate
and FUNC
(as in
AC_CHECK_FUNC
, AC_FUNC_FNMATCH
etc.) while
./testsuite -k autoupdate -k FUNC
runs all the tests tagged with
autoupdate
or FUNC
.
--errexit
-e
--debug
.
--verbose
-v
--debug
-d
--trace
-x