trace(1): resolve all level-5 LLVM warnings
[minix3.git] / bin / ed / test / ckscripts.sh
blob86a19b18d89f89199aea96691a89e135c80806df
1 #!/bin/sh -
2 # $NetBSD: ckscripts.sh,v 1.9 1995/04/23 10:07:34 cgd Exp $
4 # This script runs the .ed scripts generated by mkscripts.sh
5 # and compares their output against the .r files, which contain
6 # the correct output
8 PATH="/bin:/usr/bin:/usr/local/bin/:."
9 ED=$1
10 [ ! -x $ED ] && { echo "$ED: cannot execute"; exit 1; }
12 # Run the *.red scripts first, since these don't generate output;
13 # they exit with non-zero status
14 for i in *.red; do
15 echo $i
16 if $i; then
17 echo "*** The script $i exited abnormally ***"
19 done >errs.o 2>&1
21 # Run the remainding scripts; they exit with zero status
22 for i in *.ed; do
23 # base=`expr $i : '\([^.]*\)'`
24 # base=`echo $i | sed 's/\..*//'`
25 base=`$ED - \!"echo $i" <<-EOF
26 s/\..*
27 EOF`
28 if $base.ed; then
29 if cmp -s $base.o $base.r; then :; else
30 echo "*** Output $base.o of script $i is incorrect ***"
32 else
33 echo "*** The script $i exited abnormally ***"
35 done >scripts.o 2>&1
37 grep -h '\*\*\*' errs.o scripts.o