]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: hard errors in case of internal failure or signal caught
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 12 Nov 2010 14:45:22 +0000 (15:45 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 15 Jan 2011 17:35:59 +0000 (18:35 +0100)
* tests/defs: Exit with status 99 (hard error) rather than
1 (failure) on unexpected/internal errors, or when a signal
is caught by the client script.

ChangeLog
tests/defs

index 6001d6962d6fabfd8bcefdcfe81ca2204bda1191..99904b233cfccb7c49db8b63847397060f0e84b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-01-15  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       tests: hard error in case of internal failures or signal caught
+       * tests/defs: Exit with status 99 (hard error) rather than
+       1 (failure) on unexpected/internal errors, or when a signal
+       is caught by the client script.
+
        Tests defs: don't let useless variables leak in test scripts.
        * tests/defs ($priv_check_temp, $overwrite_status, $ro_dir_temp,
        $create_status, $r2h, $libtool_found, $gettext_found, $aclocaldir,
index 6a5c7afd63d4f8fb2aa242f938b5a990d56bd1a1..41c3505a28b37d30628efc5921c048c33834c8d5 100644 (file)
@@ -24,7 +24,7 @@
 # Ensure we are running from the right directory.
 test -f ./defs-static || {
    echo "$0: ./defs-static: not found in current directory" >&2
-   exit 1
+   exit 99
 }
 
 # Source the shell sanitization and variables' definitions.
@@ -41,13 +41,13 @@ me=`echo "$argv0" | sed -e 's,.*[\\/],,;s/\.test$//'`
 # Ensure $testsrcdir is set correctly.
 test -f "$testsrcdir/defs-static.in" || {
    echo "$me: $testsrcdir/defs-static.in not found, check \$testsrcdir" >&2
-   exit 1
+   exit 99
 }
 
 # Ensure $testbuilddir is set correctly.
 test -f "$testbuilddir/defs-static" || {
    echo "$me: $testbuilddir/defs-static not found, check \$testbuilddir" >&2
-   exit 1
+   exit 99
 }
 
 # Unset some MAKE... variables that may cause $MAKE to act like a
@@ -229,8 +229,8 @@ do
       # Skip this test case if the user is root.
       # We try to append to a read-only file to detect this.
       priv_check_temp=priv-check.$$
-      touch $priv_check_temp || exit 1
-      chmod a-w $priv_check_temp || exit 1
+      touch $priv_check_temp || exit 99
+      chmod a-w $priv_check_temp || exit 99
       (echo foo >> $priv_check_temp) >/dev/null 2>&1
       overwrite_status=$?
       rm -f $priv_check_temp
@@ -255,8 +255,8 @@ do
       # Skip this test case if read-only directories aren't supported
       # (e.g., under DOS.)
       ro_dir_temp=ro_dir.$$
-      mkdir $ro_dir_temp || exit 1
-      chmod a-w $ro_dir_temp || exit 1
+      mkdir $ro_dir_temp || exit 99
+      chmod a-w $ro_dir_temp || exit 99
       (: > $ro_dir_temp/probe) >/dev/null 2>/dev/null
       create_status=$?
       rm -rf $ro_dir_temp
@@ -436,14 +436,14 @@ if test "$sh_errexit_works" = yes; then
     exit $exit_status
   ' 0
   for signal in 1 2 13 15; do
-    trap 'signal='$signal'; { Exit 1; }' $signal
+    trap 'signal='$signal'; { Exit 99; }' $signal
   done
   signal=0
 fi
 
 # Copy in some files we need.
 for file in install-sh missing depcomp; do
-   cp "$top_testsrcdir/lib/$file" . || Exit 1
+   cp "$top_testsrcdir/lib/$file" . || Exit 99
 done
 
 # Build appropriate environment in test directory.  Eg create