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