]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Run all tests even if some fails.
authorJim Meyering <jim@meyering.net>
Mon, 8 Feb 1999 04:01:34 +0000 (04:01 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 8 Feb 1999 04:01:34 +0000 (04:01 +0000)
Don't use trap.

tests/stty/basic-1

index 2d2e7d19116ebeeea9dba935c3a4ae32684efdf7..4a44aa626e3e0f9a148c69cf0add494ea932b843 100755 (executable)
@@ -20,21 +20,20 @@ REV_ctlecho=1 REV_echoke=1 REV_crtkill=1 REV_evenp=1 REV_parity=1
 REV_oddp=1 REV_nl=1 REV_cooked=1 REV_raw=1 REV_pass8=1 REV_litout=1
 REV_cbreak=1 REV_decctlq=1 REV_tabs=1 REV_lcase=1 REV_LCASE=1
 
+fail=0
 saved_state=.saved-state
-stty --save > $saved_state || exit 1
-trap "status=$?; stty `cat $saved_state`; rm -f $saved_state; exit $status" \
-  0 1 2 3 15
-stty `cat $saved_state` || exit 1
+stty --save > $saved_state || fail=1
+stty `cat $saved_state` || fail=1
 
 # Build a list of all boolean options stty accepts on this system.
 options=`stty -a|tail +2|tr ';' '\012'|sed '/ = /d;s/^ //'|tr -s ' -' '\012'`
 
 # Take them one at a time, with and without the leading `-'.
 for opt in $options; do
-  stty $opt || exit 1
+  stty $opt || fail=1
   rev=`eval echo "\\\$REV_$opt"`
   if test -n "$rev"; then
-    stty -$opt || exit 1
+    stty -$opt || fail=1
   fi
 done
 
@@ -44,21 +43,24 @@ if test -n "$RUN_LONG_TESTS"; then
     echo .|tr -d '\012'
     for opt2 in $options; do
 
-      stty $opt1 $opt2 || exit 1
+      stty $opt1 $opt2 || fail=1
 
       rev1=`eval echo "\\\$REV_$opt1"`
       rev2=`eval echo "\\\$REV_$opt2"`
       if test -n "$rev1"; then
-       stty -$opt1 $opt2 || exit 1
+       stty -$opt1 $opt2 || fail=1
       fi
       if test -n "$rev2"; then
-       stty $opt1 -$opt2 || exit 1
+       stty $opt1 -$opt2 || fail=1
       fi
       if test "$rev1$rev2" = 11; then
-       stty -$opt1 -$opt2 || exit 1
+       stty -$opt1 -$opt2 || fail=1
       fi
     done
   done
 fi
 
-exit 0
+stty `cat $saved_state`
+rm -f $saved_state
+
+exit $fail