From 1fc622b4d14bf333932bceae7ddd7025f1d0f07d Mon Sep 17 00:00:00 2001 From: bluhm Date: Sun, 14 Jan 2018 22:01:48 +0000 Subject: [PATCH] Run the tests provided in /usr/src/bin/ed/test with the regress framework. Three ed tests are currently failing for unknown reasons. They are marked as disabled for now. from Sergey Bronnikov --- regress/bin/ed/Makefile | 74 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 regress/bin/ed/Makefile diff --git a/regress/bin/ed/Makefile b/regress/bin/ed/Makefile new file mode 100644 index 00000000000..fb800d0ba5f --- /dev/null +++ b/regress/bin/ed/Makefile @@ -0,0 +1,74 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2018/01/14 22:01:48 bluhm Exp $ + +ED ?= /bin/ed +TESTDIR = ${.CURDIR}/../../../bin/ed/test + +TS != cd ${TESTDIR} && ls *.t +ERRS != cd ${TESTDIR} && ls *.err +CLEANFILES = *.t *.d *.ed *.err *.red *.o !.z stamp-* + +run-regress-i3.red run-regress-nl.red run-regress-s2.red: + @echo '\n======== $t.red ========' + # This test currently fails, but it passes with rev 1.1 of ed. + # The regression should be investigated. + @echo DISABLED + +.for t in ${TS:R} +# from /usr/src/bin/ed/test/mkscripts.sh, converted to make rule +$t.ed: ${TESTDIR}/$t.t ${TESTDIR}/$t.d Makefile + @echo '\n======== setup $t.ed ========' + cp ${TESTDIR}/$t.t ${TESTDIR}/$t.d . + ( \ + echo "#!/bin/sh -"; \ + echo "${ED} - <<\EOT"; \ + echo H; \ + echo "r $t.d"; \ + cat $t.t; \ + echo "w $t.o"; \ + echo EOT; \ + ) >$t.tmp + mv $t.tmp $t.ed + chmod +x $t.ed + +REGRESS_TARGETS += run-regress-$t.ed +# from /usr/src/bin/ed/test/ckscripts.sh, converted to make rule +run-regress-$t.ed: $t.ed + @echo '\n======== $t.ed ========' + ./$t.ed + cmp -s $t.o ${TESTDIR}/$t.r +.endfor + +.for t in ${ERRS:R} +# from /usr/src/bin/ed/test/mkscripts.sh, converted to make rule +$t.red: ${TESTDIR}/$t.err Makefile + @echo '\n======== setup $t.red ========' + cp ${TESTDIR}/$t.err . + ( \ + echo "#!/bin/sh -"; \ + echo "${ED} - <<\EOT"; \ + echo H; \ + echo "r $t.err"; \ + cat $t.err; \ + echo "w $t.o"; \ + echo EOT; \ + ) >$t.tmp + mv $t.tmp $t.red + chmod +x $t.red + +REGRESS_TARGETS += run-regress-$t.red +# from /usr/src/bin/ed/test/ckscripts.sh, converted to make rule +run-regress-$t.red: $t.red + @echo '\n======== $t.red ========' + ! ./$t.red +.endfor + +# from /usr/src/bin/ed/test/README, known failing tests +REGRESS_SKIP_TARGETS+= run-regress-eq.red \ + run-regress-a1.red \ + run-regress-i1.red \ + run-regress-k1.red \ + run-regress-r1.red + +.PHONY: ${REGRESS_TARGETS} + +.include -- 2.20.1