Home | History | Annotate | Line # | Download | only in test
ckscripts.sh revision 1.1
      1 #!/bin/sh -
      2 # This script runs the .ed scripts generated by mkscripts.sh
      3 # and compares their output against the .r files, which contain
      4 # the correct output
      5 
      6 PATH="/bin:/usr/bin:/usr/local/bin/:."
      7 [ X"$ED" = X ] && ED="../ed"
      8 
      9 for i in *.ed; do
     10 	base=`echo $i | sed 's/\..*/'`
     11 #	base=`$ED - <<-EOF
     12 #	r !echo $i
     13 #	s/\..*
     14 #	EOF`
     15 	if $base.ed >/dev/null 2>&1; then
     16 		if cmp -s $base.o $base.r; then :; else
     17 			echo "*** Output $base.o of script $i is incorrect ***"
     18 		fi
     19 	else
     20 		echo "*** The script $i exited abnormally ***"
     21 	fi
     22 done
     23