]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
testsuite: fixlets and improvements in two long TAP-based tests
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 13 Aug 2011 09:52:26 +0000 (11:52 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 13 Aug 2011 19:04:03 +0000 (21:04 +0200)
* tests/depmod.tap: Clean up the subdirectories used by tests that
passed, to avoid ending up with a too big test directory.  This is
especially important since, on each and every system, at least some
tests in this script are expected to be skipped (which ones exactly
depends on the system), thus causing the test directory not to be
removed when the script terminates.
* tests/instspc.tap: Likewise (with the difference that tests here
are not expected to be skipped, but to xfail).  Give more explicit
error message in case of setup failure.  Skip the proper number of
tests when required, to avoid spurious errors due to mismatched
plan.  Also, really avoid to run the unsupported test cases when
the need to skip them is detected.

ChangeLog
tests/depmod.tap
tests/instspc.tap

index d91bc5957d338011954f04eb20cbab7ea256ea7f..1d4ee094cabc3e7f5ba96960e01a8c588d7d54b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2011-08-13  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       testsuite: fixlets and improvements in two long TAP-based tests
+       * tests/depmod.tap: Clean up the subdirectories used by tests that
+       passed, to avoid ending up with a too big test directory.  This is
+       especially important since, on each and every system, at least some
+       tests in this script are expected to be skipped (which ones exactly
+       depends on the system), thus causing the test directory not to be
+       removed when the script terminates.
+       * tests/instspc.tap: Likewise (with the difference that tests here
+       are not expected to be skipped, but to xfail).  Give more explicit
+       error message in case of setup failure.  Skip the proper number of
+       tests when required, to avoid spurious errors due to mismatched
+       plan.  Also, really avoid to run the unsupported test cases when
+       the need to skip them is detected.
+
 2011-08-09  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        test harness: recursive make invocations must use $(AM_MAKEFLAGS)
index 82fd844698bab13afe9d25ea6ec065bc0ba04e84..c40fea82746fff4e10368d50081413e2b8599988 100755 (executable)
@@ -146,28 +146,44 @@ for vpath in simple long absolute; do
     mkdir $depmode-$vpath.d
     cd $depmode-$vpath.d
 
-    command_ok_ "$pfx configure" \
-      "$srcdir"/configure am_cv_CC_dependencies_compiler_type=$depmode
+    if "$srcdir"/configure am_cv_CC_dependencies_compiler_type=$depmode
+    then
+      r0='ok'
+    else
+      r0='not ok'
+    fi
+    result_ "$r0" "$pfx configure" \
 
     # Do not fail with the first call to make fails, as the depmode
     # we've forced might not actually work, but we have overridden the
     # _AM_DEPENDENCIES tests.
+    r1='not ok'
     if $MAKE; then
       # We must clean and rebuild, as the actual error only happens the
       # second time the objects are built because 'depcomp' has silently
       # messed up the .Po files the first time.
-      r=ok
       $MAKE clean \
         && { e=0; $MAKE >output 2>&1 || e=1; cat output; test $e -eq 0; } \
         && { if grep 'src/[._]deps' output; then false; else :; fi; } \
-        || r='not ok'
-      result_ "$r" "$pfx make & remake"
+        && r1='ok'
+      result_ "$r1" "$pfx make & remake"
     else
       skip_ -r "can't force depmode" "$pfx make & remake"
     fi
 
     cd "$ocwd" || fatal_ "cannot chdir back to top directory"
 
+    # Remove subdirectories for tests that have passed, to avoid ending up
+    # with a too big test directory.  This is especially important since,
+    # on each and every system, at least some tests in this script are
+    # expected to be skipped (which ones exactly depends on the system),
+    # thus causing the test directory not to be removed when the script
+    # terminates.
+    case $keep_testdirs,$r0,$r1 in
+      ,ok,ok) rm_rf_ $depmode-$vpath.d;;
+      *) : For lesser shells with broken 'set -e';;
+    esac
+
   done
 done
 
index dc52299011be9138e43a217eca9878b28eb56676..46f4b4e2d52cce846153b0d7469c2b52e22953b1 100755 (executable)
@@ -136,9 +136,9 @@ EOF
        test   -f '$(DESTDIR)/$(file)-prefix/foo/libbase.a'
 EOF
 
-  $ACLOCAL
-  $AUTOCONF
-  $AUTOMAKE -a
+  $ACLOCAL  || framework_failure_ "aclocal failed"
+  $AUTOCONF || framework_failure_ "autoconf failed"
+  $AUTOMAKE || framework_failure_ "automake failed"
 }
 
 # ================= #
@@ -223,8 +223,11 @@ for test_name in $test_names_list; do
   # Skip the next checks if this system doesn't support the required
   # characters in file names.
 
-  mkdir "./$test_string" || \
-    skip_ -r "mkdir failed" "$test_name"
+  mkdir "./$test_string" || {
+    skip_ -r "mkdir failed" "$test_name in builddir"
+    skip_ -r "mkdir failed" "$test_name in destdir"
+    continue
+  }
 
   # Where are the "weird" characters going to be used, in $(builddir)
   # or in $(DESTDIR)?  They are always going to be used in $(prefix)
@@ -271,6 +274,15 @@ for test_name in $test_names_list; do
 
     cd "$ocwd" || fatal_ "cannot chdir back to test directory"
 
+    # Remove subdirectories for tests that have passed, to avoid ending up
+    # with a too big test directory.  This is especially important since
+    # some tests in this tests are expected to fail, and this will cause
+    # the test directory not to be removed when the script terminates.
+    case $keep_testdirs,$r1 in
+      ,ok) rm_rf_ $depmode-$vpath.d;;
+        *) : For lesser shells with broken 'set -e';;
+    esac
+
   done # $instspc_action
 
 done # $test_name