]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Run each test in a process-private subdirectory.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 10 Nov 2007 10:11:21 +0000 (11:11 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 10 Nov 2007 10:11:38 +0000 (11:11 +0100)
* tests/defs.in: Employ a trap to clean up at the end of the
test in case the test succeeded.  This needs to be revisited
because we would like to keep the output of XPASSing tests.
Also, note when we were interrupted by a signal.  Code taken
from Autoconf's _AC_INIT_PREPARE.
If $keep_testdirs is set, keep them even for successful tests.
* tests/Makefile.am (check-clean-local): New target.  Remove all
tests subdirs, but also make them writable first.  The latter
was already needed without per-test subdirs.
(distclean-local): Depend upon check-clean-local.
* tests/Makefile.in: Regenerate.
* tests/.cvsignore, tests/.gitignore: Adjust.

ChangeLog
HACKING
tests/.cvsignore
tests/.gitignore
tests/Makefile.am
tests/Makefile.in
tests/defs.in

index fa941b46b5eef1b3e935fab84664a79a2b6dce57..b79015ec925df5f91eefa260aa81136afa521efb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2007-11-10  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Run each test in a process-private subdirectory.
+       * tests/defs.in: Employ a trap to clean up at the end of the
+       test in case the test succeeded.  This needs to be revisited
+       because we would like to keep the output of XPASSing tests.
+       Also, note when we were interrupted by a signal.  Code taken
+       from Autoconf's _AC_INIT_PREPARE.
+       If $keep_testdirs is set, keep them even for successful tests.
+       * tests/Makefile.am (check-clean-local): New target.  Remove all
+       tests subdirs, but also make them writable first.  The latter
+       was already needed without per-test subdirs.
+       (distclean-local): Depend upon check-clean-local.
+       * tests/Makefile.in: Regenerate.
+       * tests/.cvsignore, tests/.gitignore: Adjust.
+
        Fix default includes ordering to be `-I. -I$(srcdir) ...' again.
        * automake.in (handle_compile): Put -I$(srcdir) before include
        paths for config headers, as was done before Automake 1.10, but
diff --git a/HACKING b/HACKING
index 5a3ed338a945bfb0f9c721caaf3adf2584717801..9f2f1f4fade8c7323bb535c8f48a63e24aee7e8d 100644 (file)
--- a/HACKING
+++ b/HACKING
 
 * Make sure each test file is executable
 
+* Use `keep_testdirs=yes' to keep test directories for successful
+  tests also.
 
 ================================================================
 = Release procedure
index c28dc161b53cf3b82690d167d153e1335f77a6fd..69d3d43f3e5c814f099832bf3f1b3394abded4ae 100644 (file)
@@ -5,6 +5,6 @@ automake
 defs
 diffs
 log
-testSubDir
+*.dir
 aclocal-*
 automake-*
index 0859387eb3d47c9bc7c975d025428086b623136e..f1c3bff3388f0833321c975de27acf7906678f1e 100644 (file)
@@ -1,4 +1,4 @@
 aclocal-*
 automake-*
 defs
-testSubDir
+*.dir
index 81a038221983bdfc9f727f049ac26e19ab11decc..3c586a1dc3436f57c52d0825375da53a4bf0bca9 100644 (file)
@@ -627,5 +627,8 @@ EXTRA_DIST = ChangeLog-old $(TESTS)
 # Each test case depends on defs, aclocal, and automake.
 check_SCRIPTS = defs aclocal-$(APIVERSION) automake-$(APIVERSION)
 
-distclean-local:
-       -rm -rf testSubDir
+distclean-local: check-clean-local
+
+check-clean-local:
+       -chmod -R u+rwx *.dir
+       -rm -rf *.dir
index 999ed24094011369904f56e78b6b6cea711dbe71..b446130551831006c292182bd2e1af0d55e0445b 100644 (file)
@@ -1023,8 +1023,11 @@ uninstall-am:
        pdf-am ps ps-am uninstall uninstall-am
 
 
-distclean-local:
-       -rm -rf testSubDir
+distclean-local: check-clean-local
+
+check-clean-local:
+       -chmod -R u+rwx *.dir
+       -rm -rf *.dir
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 78cf37a99d1ad3c663504cd711d4ea6ddfb037d8..d79d874e657e1ee8a4f6794a16919776efac0130 100644 (file)
@@ -235,16 +235,35 @@ case "$srcdir" in
     ;;
 esac
 
-chmod -R a+rwx testSubDir > /dev/null 2>&1
-rm -rf testSubDir > /dev/null 2>&1
-mkdir testSubDir
+curdir=`pwd`
+testSubDir=$me.dir
+chmod -R u+rwx $testSubDir > /dev/null 2>&1
+rm -rf $testSubDir > /dev/null 2>&1
+mkdir $testSubDir
+
+trap 'exit_status=$?
+  cd "$curdir"
+  case $exit_status,$keep_testdirs in
+  0,)
+    chmod -R a+rwx $testSubDir > /dev/null 2>&1
+    rm -rf "$testSubDir" ;;
+  esac
+  test "$signal" != 0 &&
+    echo "$as_me: caught signal $signal"
+  echo "$as_me: exit $exit_status"
+  exit $exit_status
+' 0
+for signal in 1 2 13 15; do
+  trap 'signal='$signal'; { (exit 1); exit 1; }' $signal
+done
+signal=0
 
 # Copy in some files we need.
 for file in install-sh missing depcomp; do
-   cp $srcdir/../lib/$file testSubDir/$file || exit 1
+   cp $srcdir/../lib/$file $testSubDir/$file || exit 1
 done
 
-cd ./testSubDir
+cd ./$testSubDir
 
 # Build appropriate environment in test directory.  Eg create
 # configure.in, touch all necessary files, etc.