Improve C++ support.
[dragonfly/netmp.git] / bin / ed / test / ckscripts.sh
blob80d2038620d017d3f05deb44140ce391dfde7442
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
6 # $FreeBSD: src/bin/ed/test/ckscripts.sh,v 1.6 1999/08/27 23:14:18 peter Exp $
7 # $DragonFly: src/bin/ed/test/ckscripts.sh,v 1.2 2003/06/17 04:22:50 dillon Exp $
9 PATH="/bin:/usr/bin:/usr/local/bin/:."
10 ED=$1
11 [ ! -x $ED ] && { echo "$ED: cannot execute"; exit 1; }
13 # Run the *.red scripts first, since these don't generate output;
14 # they exit with non-zero status
15 for i in *.red; do
16 echo $i
17 if $i; then
18 echo "*** The script $i exited abnormally ***"
20 done >errs.o 2>&1
22 # Run the remainding scripts; they exit with zero status
23 for i in *.ed; do
24 # base=`expr $i : '\([^.]*\)'`
25 # base=`echo $i | sed 's/\..*//'`
26 base=`$ED - \!"echo $i" <<-EOF
27 s/\..*
28 EOF`
29 if $base.ed; then
30 if cmp -s $base.o $base.r; then :; else
31 echo "*** Output $base.o of script $i is incorrect ***"
33 else
34 echo "*** The script $i exited abnormally ***"
36 done >scripts.o 2>&1
38 grep -h '\*\*\*' errs.o scripts.o