* lib/autotest/general.m4 (AT_INIT): New variable $at_recheck.
Escape hyphen in $at_dir early. Accept command line switch
--recheck. Set $at_suite_log early, based on --directory
switch; with --recheck, include the list of FAILed and XPASSed
tests from old testsuite.log file in $at_groups. Document
--recheck in --help output.
* tests/autotest.at (recheck): New test.
* doc/autoconf.texi (testsuite Invocation): Document --recheck.
* NEWS: Update.
Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+2010-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ New Autotest testsuite option --recheck.
+ * lib/autotest/general.m4 (AT_INIT): New variable $at_recheck.
+ Escape hyphen in $at_dir early. Accept command line switch
+ --recheck. Set $at_suite_log early, based on --directory
+ switch; with --recheck, include the list of FAILed and XPASSed
+ tests from old testsuite.log file in $at_groups. Document
+ --recheck in --help output.
+ * tests/autotest.at (recheck): New test.
+ * doc/autoconf.texi (testsuite Invocation): Document --recheck.
+ * NEWS: Update.
+
2010-06-14 Karl Berry <karl@freefriends.org> (tiny change)
Clarify comment about old system.
** AS_SET_CATFILE accepts nonliterals in its variable name argument now.
+** Autotest testsuites accept an option --recheck to rerun tests that
+ failed or passed unexpectedly during the last non-debug testsuite run.
+
* Major changes in Autoconf 2.65 (2009-11-21) [stable]
Released by Eric Blake, based on git versions 2.64.*.
the default for debugging scripts, but it can also be useful to debug
the testsuite itself.
+@item --recheck
+Add to the selection all test groups that failed or passed unexpectedly
+during the last non-debugging test run.
+
@item --trace
@itemx -x
Trigger shell tracing of the test groups.
at_clean=false
# Test groups to run
at_groups=
+# Whether to rerun failed tests.
+at_recheck=
# Whether a write failure occurred
at_write_fail=0
--directory=* )
at_change_dir=:
at_dir=$at_optarg
+ if test x- = "x$at_dir" ; then
+ at_dir=./-
+ fi
;;
# Parallel execution.
`
AS_VAR_APPEND([at_groups], ["$at_groups_selected "])
;;
+ --recheck)
+ at_recheck=:
+ ;;
m4_divert_pop([PARSE_ARGS])dnl
dnl Process *=* last to allow for user specified --option=* type arguments.
m4_divert_push([PARSE_ARGS_END])dnl
# Verify our last option didn't require an argument
AS_IF([test -n "$at_prev"], [AS_ERROR([`$at_prev' requires an argument])])
+# The file containing the suite.
+at_suite_log=$at_dir/$as_me.log
+
# Selected test groups.
-if test -z "$at_groups"; then
+if test -z "$at_groups$at_recheck"; then
at_groups=$at_groups_all
else
+ if test -n "$at_recheck" && test -r "$at_suite_log"; then
+ at_oldfails=`sed -n ['
+ /^Failed tests:$/,/^Skipped tests:$/{
+ s/^[ ]*\([1-9][0-9]*\):.*/\1/p
+ }
+ /^Unexpected passes:$/,/^## Detailed failed tests/{
+ s/^[ ]*\([1-9][0-9]*\):.*/\1/p
+ }
+ /^## Detailed failed tests/q
+ '] "$at_suite_log" | tr "$as_nl" ' '`
+ AS_VAR_APPEND([at_groups], ["$at_oldfails"])
+ fi
# Sort the tests, removing duplicates.
at_groups=`AS_ECHO(["$at_groups"]) | tr ' ' "$as_nl" | sort -nu`
fi
-k, --keywords=KEYWORDS
[ select the tests matching all the comma-separated KEYWORDS]
[ multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD]
+ --recheck select all tests that failed or passed unexpectedly last time
-e, --errexit abort as soon as a test fails; implies --debug
-v, --verbose force more detailed output
[ default for debugging scripts]
# Take any -C into account.
if $at_change_dir ; then
- if test x- = "x$at_dir" ; then
- at_dir=./-
- fi
test x != "x$at_dir" && cd "$at_dir" \
|| AS_ERROR([unable to change directory])
at_dir=`pwd`
# The directory the whole suite works in.
# Should be absolute to let the user `cd' at will.
at_suite_dir=$at_dir/$as_me.dir
-# The file containing the suite.
+# The file containing the suite ($at_dir might have changed since earlier).
at_suite_log=$at_dir/$as_me.log
# The directory containing helper files per test group.
at_helper_dir=$at_suite_dir/at-groups
])
+# --recheck.
+AT_CHECK_AT_TEST([recheck],
+ [AT_CHECK([:])
+ AT_CLEANUP
+ AT_SETUP([failing test])
+ AT_CHECK([exit 1])
+ AT_CLEANUP
+ AT_SETUP([xpassing test])
+ AT_XFAIL_IF([:])
+ AT_CHECK([:])
+ AT_CLEANUP
+ AT_SETUP([xfailing test])
+ AT_XFAIL_IF([:])
+ AT_CHECK([exit 1])
+], [], [], [], [], [], [
+AT_CHECK([$CONFIG_SHELL ./micro-suite --recheck], [0], [stdout])
+AT_CHECK([grep "0 tests were successful" stdout], [0], [ignore])
+
+AT_CHECK([$CONFIG_SHELL ./micro-suite], [1], [ignore], [ignore])
+AT_CHECK([grep 'only test' micro-suite.log], [0], [ignore])
+AT_CHECK([$CONFIG_SHELL ./micro-suite --recheck], [1], [ignore], [ignore])
+AT_CHECK([grep 'only test' micro-suite.log], [1])
+AT_CHECK([grep 'xfailing' micro-suite.log], [1])
+AT_CHECK([grep 'failing test' micro-suite.log], [0], [ignore])
+AT_CHECK([grep 'xpassing test' micro-suite.log], [0], [ignore])
+
+AT_CHECK([$CONFIG_SHELL ./micro-suite --clean], [0])
+AT_CHECK([test -f micro-suite.log], [1])
+
+dnl check specifying a different relative path to run in.
+AT_CHECK([mkdir sub1])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -C sub1], [1], [ignore], [ignore])
+AT_CHECK([test -f micro-suite.log], [1])
+AT_CHECK([test -f sub1/micro-suite.log], [0])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -C sub1 --recheck --list], [0], [stdout])
+AT_CHECK([grep 'only test' stdout], [1])
+AT_CHECK([grep 'xfailing test' stdout], [1])
+AT_CHECK([grep 'failing test' stdout], [0], [ignore])
+AT_CHECK([grep 'xpassing test' stdout], [0], [ignore])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -C sub1 --recheck], [1], [ignore],
+ [ignore])
+AT_CHECK([grep 'failing test' sub1/micro-suite.log], [0], [ignore])
+AT_CHECK([grep 'xpassing test' sub1/micro-suite.log], [0], [ignore])
+], [1 4])
+
+
## -------- ##
## Banners. ##
## -------- ##