+2008-02-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * lib/autotest/general.m4 (AT_INIT): Fix --clean to work
+ again, broken since introduction of `-C dir'.
+ * tests/autotest.at (Choosing where testsuite is run): Test it.
+
2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
* doc/autoconf.texi: Update Back-Cover text to reflect new GNU wording.
at_version_p=false
# List test groups?
at_list_p=false
+# --clean
+at_clean=false
# Test groups to run
at_groups=
# Whether a write failure occurred
;;
--clean | -c )
- test -d "$at_suite_dir" &&
- find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
- rm -f -r "$at_suite_dir" "$at_suite_log"
- exit $?
+ at_clean=:
;;
--debug | -d )
# The file containing dates.
at_times_file=$at_suite_dir/at-times
+if $at_clean; then
+ test -d "$at_suite_dir" &&
+ find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
+ rm -f -r "$at_suite_dir" "$at_suite_log"
+ exit $?
+fi
+
# Don't take risks: use only absolute directories in PATH.
#
# For stand-alone test suites (ie. atconfig was not found),
AT_CHECK_AT_TEST([Choosing where testsuite is run],
[AT_CHECK([:])], [], [], [], [], [
dnl AT_CHECK_AT_TEST tests the default of running in `.'.
-AT_CHECK([rm micro-suite.log && mkdir sub1 sub2])
+AT_CHECK([$CONFIG_SHELL ./micro-suite --clean])
+AT_CHECK([test -f micro-suite.log], [1])
+AT_CHECK([test -d micro-suite.dir], [1])
+AT_CHECK([mkdir sub1 sub2])
dnl check specifying a different relative path to run in.
AT_CHECK([$CONFIG_SHELL ./micro-suite -C sub1], [0], [ignore], [])
AT_CHECK([test -f micro-suite.log], [1])
AT_CHECK([test -f sub1/micro-suite.log], [0])
+AT_CHECK([test -d micro-suite.dir], [1])
+AT_CHECK([test -d sub1/micro-suite.dir], [0])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -C sub1 --clean])
+AT_CHECK([test -f sub1/micro-suite.log], [1])
+AT_CHECK([test -d sub1/micro-suite.dir], [1])
dnl check specifying an absolute path to run in.
AT_CHECK([$CONFIG_SHELL ./micro-suite --directory="`pwd`/sub2"],
[0], [ignore], [])
AT_CHECK([test -f micro-suite.log], [1])
AT_CHECK([test -f sub2/micro-suite.log], [0])
+AT_CHECK([$CONFIG_SHELL ./micro-suite --clean --directory="`pwd`/sub2"])
+AT_CHECK([test -f sub2/micro-suite.log], [1])
+AT_CHECK([test -f sub2/micro-suite.dir], [1])
dnl check for failure detection with bad, missing, or empty directory.
AT_CHECK([$CONFIG_SHELL ./micro-suite -C nonesuch], [1], [ignore], [ignore])
AT_CHECK([$CONFIG_SHELL ./micro-suite -C ''], [1], [ignore], [ignore])