]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix autotest --clean, and make it work with `-C dir'.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 1 Feb 2008 23:10:25 +0000 (00:10 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Fri, 1 Feb 2008 23:10:25 +0000 (00:10 +0100)
* 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.

ChangeLog
lib/autotest/general.m4
tests/autotest.at

index e9c2ad2da9d45b22bbaf64e1ba991e7b9c6c43ef..bfbc665ea5bd5780650bed8af64aef73a6f0cb31 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
index 5f60f86c305c3a9d01ba9c88e0735e025c08ae9a..939119a083cc89cf85ef93f184d0da3156afdc68 100644 (file)
@@ -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),
index d9486d0856c0f6cadd42597deb266a04959ab20e..b865e9ef420a3d362c65b782ae2b1fd92ef4c04b 100644 (file)
@@ -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])