From: Ralf Wildenhues Date: Fri, 1 Feb 2008 23:10:25 +0000 (+0100) Subject: Fix autotest --clean, and make it work with `-C dir'. X-Git-Tag: v2.62~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c573f843ccd29d3422fe7c408b74ddd7a9f48fba;p=thirdparty%2Fautoconf.git Fix autotest --clean, and make it work with `-C dir'. * 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. --- diff --git a/ChangeLog b/ChangeLog index e9c2ad2d..bfbc665e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-02 Ralf Wildenhues + + * 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 * doc/autoconf.texi: Update Back-Cover text to reflect new GNU wording. diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4 index 5f60f86c..939119a0 100644 --- a/lib/autotest/general.m4 +++ b/lib/autotest/general.m4 @@ -385,6 +385,8 @@ at_help_p=false 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 @@ -460,10 +462,7 @@ do ;; --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 ) @@ -757,6 +756,13 @@ at_test_source=$at_suite_dir/at-test-source # 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), diff --git a/tests/autotest.at b/tests/autotest.at index d9486d08..b865e9ef 100644 --- a/tests/autotest.at +++ b/tests/autotest.at @@ -435,16 +435,27 @@ AT_CHECK([$CONFIG_SHELL ./micro-suite 1=2], [1], [], [ignore], [ignore]) 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])