*** sanity.sh.orig	Wed Jun 28 17:30:04 2000
--- sanity.sh	Wed Jun 28 16:58:28 2000
***************
*** 80,85 ****
--- 80,88 ----
  remote=no
  startwith=""
  reached_start="yes"
+ keepgoing=no
+ this_test_failed_already=no
+ at_least_one_test_failed=no
  
  options_left=yes;
  while [ "$options_left" = "yes" ]
***************
*** 106,111 ****
--- 109,120 ----
  			reached_start=no
  			shift
  			;;
+ 		"x--keepgoing")
+ 			# keep going when you fail a test, just skip all
+ 			# the remaining tests in that group.
+ 			keepgoing=yes
+ 			shift
+ 			;;
  		esac
  	fi
  done
***************
*** 373,379 ****
  {
    echo "FAIL: $1" | tee -a ${LOGFILE}
    # This way the tester can go and see what remnants were left
!   exit 1
  }
  
  # See dotest and dotest_fail for explanation (this is the parts
--- 382,395 ----
  {
    echo "FAIL: $1" | tee -a ${LOGFILE}
    # This way the tester can go and see what remnants were left
! 
!   if [ "$keepgoing" = "yes" ]
!   then
! 	this_test_failed_already=yes
! 	at_least_one_test_failed=yes
!   else
!   	exit 1
!   fi
  }
  
  # See dotest and dotest_fail for explanation (this is the parts
***************
*** 541,546 ****
--- 557,568 ----
  # lack \|).
  dotest ()
  {
+   if [ "$this_test_failed_already" = "yes" -a "$keepgoing" = "yes" ]
+   then
+ 	# we've already failed, just skip this test and keep going.
+ 	return 0
+   fi
+ 
    rm -f ${TESTDIR}/dotest.ex? 2>&1
    if eval "$2" >${TESTDIR}/dotest.tmp 2>&1; then
      : so far so good
***************
*** 556,561 ****
--- 578,589 ----
  # Like dotest except only 2 args and result must exactly match stdin
  dotest_lit ()
  {
+   if [ "$this_test_failed_already" = "yes" -a "$keepgoing" = "yes" ]
+   then
+ 	# we've already failed, just skip this test and keep going.
+ 	return 0
+   fi
+ 
    rm -f ${TESTDIR}/dotest.ex? 2>&1
    if eval "$2" >${TESTDIR}/dotest.tmp 2>&1; then
      : so far so good
***************
*** 580,585 ****
--- 608,619 ----
  # Like dotest except exitstatus should be nonzero.
  dotest_fail ()
  {
+   if [ "$this_test_failed_already" = "yes" -a "$keepgoing" = "yes" ]
+   then
+ 	# we've already failed, just skip this test and keep going.
+ 	return 0
+   fi
+ 
    rm -f ${TESTDIR}/dotest.ex? 2>&1
    if eval "$2" >${TESTDIR}/dotest.tmp 2>&1; then
      status=$?
***************
*** 596,601 ****
--- 630,641 ----
  # Like dotest except second argument is the required exitstatus.
  dotest_status ()
  {
+   if [ "$this_test_failed_already" = "yes" -a "$keepgoing" = "yes" ]
+   then
+ 	# we've already failed, just skip this test and keep going.
+ 	return 0
+   fi
+ 
    eval "$3" >${TESTDIR}/dotest.tmp 2>&1
    status=$?
    if test "$status" = "$2"; then
***************
*** 611,616 ****
--- 651,662 ----
  # Like dotest except output is sorted.
  dotest_sort ()
  {
+   if [ "$this_test_failed_already" = "yes" -a "$keepgoing" = "yes" ]
+   then
+ 	# we've already failed, just skip this test and keep going.
+ 	return 0
+   fi
+ 
    rm -f ${TESTDIR}/dotest.ex? 2>&1
    if eval "$2" >${TESTDIR}/dotest.tmp1 2>&1; then
      : so far so good
***************
*** 770,775 ****
--- 816,824 ----
  
  ### The big loop
  for what in $tests; do
+ 
+ 	this_test_failed_already=no
+ 
  	if [ "$startwith" != "" -a "$reached_start" = "no" ]
  	then
  		if [ "$startwith" = "$what" ]
***************
*** 21152,21158 ****
  	fi # endif for --> if [ "$reached_start" = "yes" ]
  done
  
! echo "OK, all tests completed."
  
  # TODO:
  # * use "test" not "[" and see if all test's support `-z'
--- 21201,21212 ----
  	fi # endif for --> if [ "$reached_start" = "yes" ]
  done
  
! if [ "$at_least_one_test_failed" = "no" ]
! then
! 	echo "OK, all tests completed."
! else
! 	echo "At least one test failed."
! fi
  
  # TODO:
  # * use "test" not "[" and see if all test's support `-z'
