[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
testsuite --clean
From: |
Ralf Wildenhues |
Subject: |
testsuite --clean |
Date: |
Sat, 2 Feb 2008 00:11:04 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
The 'testsuite -C dir' patch broke `./testsuite --clean' (not only for
the -C case, but also for the plain case). I've applied this fix.
Cheers,
Ralf
2008-02-02 Ralf Wildenhues <address@hidden>
* 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/lib/autotest/general.m4 b/lib/autotest/general.m4
index 5f60f86..939119a 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 d9486d0..b865e9e 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])
- testsuite --clean,
Ralf Wildenhues <=