1993-04-08 05:07:16 +04:00
|
|
|
#!/bin/sh -
|
1995-04-23 14:07:18 +04:00
|
|
|
# $NetBSD: ckscripts.sh,v 1.9 1995/04/23 10:07:34 cgd Exp $
|
|
|
|
#
|
1993-04-08 05:07:16 +04:00
|
|
|
# This script runs the .ed scripts generated by mkscripts.sh
|
|
|
|
# and compares their output against the .r files, which contain
|
|
|
|
# the correct output
|
|
|
|
|
|
|
|
PATH="/bin:/usr/bin:/usr/local/bin/:."
|
1993-05-08 14:49:52 +04:00
|
|
|
ED=$1
|
|
|
|
[ ! -x $ED ] && { echo "$ED: cannot execute"; exit 1; }
|
1993-04-08 05:07:16 +04:00
|
|
|
|
1994-02-20 09:57:15 +03: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-04-10 15:46:38 +04:00
|
|
|
if $i; then
|
1994-02-20 09:57:15 +03:00
|
|
|
echo "*** The script $i exited abnormally ***"
|
1993-04-10 15:46:38 +04:00
|
|
|
fi
|
|
|
|
done >errs.o 2>&1
|
|
|
|
|
|
|
|
# Run the remainding scripts; they exit with zero status
|
1993-04-08 05:07:16 +04:00
|
|
|
for i in *.ed; do
|
1994-02-20 09:57:15 +03:00
|
|
|
# base=`expr $i : '\([^.]*\)'`
|
1993-04-13 13:29:21 +04:00
|
|
|
# base=`echo $i | sed 's/\..*//'`
|
1994-02-20 09:57:15 +03:00
|
|
|
base=`$ED - \!"echo $i" <<-EOF
|
|
|
|
s/\..*
|
|
|
|
EOF`
|
1993-04-10 15:46:38 +04:00
|
|
|
if $base.ed; then
|
1993-04-08 05:07:16 +04:00
|
|
|
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
|
1993-04-10 15:46:38 +04:00
|
|
|
done >scripts.o 2>&1
|
|
|
|
|
|
|
|
grep -h '\*\*\*' errs.o scripts.o
|