summaryrefslogtreecommitdiffstats
path: root/bin/ed/test/ckscripts.sh
diff options
context:
space:
mode:
authoralm <alm@FreeBSD.org>1993-06-18 13:00:14 +0000
committeralm <alm@FreeBSD.org>1993-06-18 13:00:14 +0000
commit8eb89f70257d1d25fd40e1414846ea1939f7d275 (patch)
tree0ebb3a1cb043f39e3d1f9fb2d2e4e2170f529687 /bin/ed/test/ckscripts.sh
parent777d9e83b8466b1892a1383f2540a711b9107887 (diff)
downloadFreeBSD-src-8eb89f70257d1d25fd40e1414846ea1939f7d275.zip
FreeBSD-src-8eb89f70257d1d25fd40e1414846ea1939f7d275.tar.gz
POSIX ed version 0.6 by Andrew Moore (alm@netcom.com).
Diffstat (limited to 'bin/ed/test/ckscripts.sh')
-rw-r--r--bin/ed/test/ckscripts.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/bin/ed/test/ckscripts.sh b/bin/ed/test/ckscripts.sh
new file mode 100644
index 0000000..87a7e9b
--- /dev/null
+++ b/bin/ed/test/ckscripts.sh
@@ -0,0 +1,37 @@
+#!/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
+
+PATH="/bin:/usr/bin:/usr/local/bin/:."
+ED=$1
+[ X"$ED" = X -o ! -x $ED ] && ED="../ed"
+[ ! -x $ED ] && { echo "$ED: cannot execute"; exit 1; }
+
+# Run the *-err.ed scripts first, since these don't generate output;
+# rename then to *-err.ed~; they exit with non-zero status
+for i in *-err.ed; do
+ echo $i~
+ if $i; then
+ echo "*** The script $i~ exited abnormally ***"
+ fi
+ mv $i $i~
+done >errs.o 2>&1
+
+# Run the remainding scripts; they exit with zero status
+for i in *.ed; do
+ base=`expr $i : '\([^.]*\)'`
+# base=`echo $i | sed 's/\..*//'`
+# base=`$ED - \!"echo \\\\$i" <<-EOF
+# s/\..*
+# EOF`
+ 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
OpenPOWER on IntegriCloud