1993-06-18 13:00:14 +00:00
|
|
|
#!/bin/sh -
|
|
|
|
# This script runs the .ed scripts generated by mkscripts.sh
|
|
|
|
# and compares their output against the .r files, which contain
|
|
|
|
# the correct output
|
1996-09-22 21:56:57 +00:00
|
|
|
#
|
1997-02-22 14:13:04 +00:00
|
|
|
# $Id$
|
1993-06-18 13:00:14 +00:00
|
|
|
|
|
|
|
PATH="/bin:/usr/bin:/usr/local/bin/:."
|
|
|
|
ED=$1
|
|
|
|
[ ! -x $ED ] && { echo "$ED: cannot execute"; exit 1; }
|
|
|
|
|
1994-02-01 00:36:28 +00:00
|
|
|
# Run the *.red scripts first, since these don't generate output;
|
|
|
|
# they exit with non-zero status
|
|
|
|
for i in *.red; do
|
|
|
|
echo $i
|
1993-06-18 13:00:14 +00:00
|
|
|
if $i; then
|
1994-02-01 00:36:28 +00:00
|
|
|
echo "*** The script $i exited abnormally ***"
|
1993-06-18 13:00:14 +00:00
|
|
|
fi
|
|
|
|
done >errs.o 2>&1
|
|
|
|
|
|
|
|
# Run the remainding scripts; they exit with zero status
|
|
|
|
for i in *.ed; do
|
1994-02-01 00:36:28 +00:00
|
|
|
# base=`expr $i : '\([^.]*\)'`
|
1993-06-18 13:00:14 +00:00
|
|
|
# base=`echo $i | sed 's/\..*//'`
|
1994-02-01 00:36:28 +00:00
|
|
|
base=`$ED - \!"echo $i" <<-EOF
|
|
|
|
s/\..*
|
|
|
|
EOF`
|
1993-06-18 13:00:14 +00:00
|
|
|
if $base.ed; then
|
|
|
|
if cmp -s $base.o $base.r; then :; else
|
|
|
|
echo "*** Output $base.o of script $i is incorrect ***"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "*** The script $i exited abnormally ***"
|
|
|
|
fi
|
|
|
|
done >scripts.o 2>&1
|
|
|
|
|
|
|
|
grep -h '\*\*\*' errs.o scripts.o
|