1# $OpenBSD: Makefile,v 1.2 2020/01/09 18:42:21 bluhm Exp $ 2 3ED ?= /bin/ed 4TESTDIR = ${.CURDIR}/../../../bin/ed/test 5 6TS != cd ${TESTDIR} && ls *.t 7ERRS != cd ${TESTDIR} && ls *.err 8CLEANFILES = *.t *.d *.ed *.err *.red *.o *.z 9 10# from /usr/src/bin/ed/test/README, known failing tests 11REGRESS_EXPECTED_FAILURES = run-eq.red \ 12 run-a1.red \ 13 run-i1.red \ 14 run-k1.red \ 15 run-r1.red 16 17REGRESS_TARGETS = 18 19.for t in ${TS:R} 20# from /usr/src/bin/ed/test/mkscripts.sh, converted to make rule 21$t.ed: ${TESTDIR}/$t.t ${TESTDIR}/$t.d Makefile 22 @echo '======== $@ ========' 23 cp ${TESTDIR}/$t.t ${TESTDIR}/$t.d . 24 ( \ 25 echo "#!/bin/sh -"; \ 26 echo "rm -f -- $t.o"; \ 27 echo "${ED} - <<\EOT"; \ 28 echo H; \ 29 echo "r $t.d"; \ 30 cat $t.t; \ 31 echo "w $t.o"; \ 32 echo EOT; \ 33 ) >$t.tmp 34 mv $t.tmp $t.ed 35 chmod +x $t.ed 36 37REGRESS_TARGETS += run-$t.ed 38# from /usr/src/bin/ed/test/ckscripts.sh, converted to make rule 39run-$t.ed: $t.ed 40 @echo '======== $@ ========' 41 ./$t.ed 42 diff -u ${TESTDIR}/$t.r $t.o 43.endfor 44 45.for t in ${ERRS:R} 46# from /usr/src/bin/ed/test/mkscripts.sh, converted to make rule 47$t.red: ${TESTDIR}/$t.err Makefile 48 @echo '======== $@ ========' 49 cp ${TESTDIR}/$t.err . 50 ( \ 51 echo "#!/bin/sh -"; \ 52 echo "rm -f -- $t.o"; \ 53 echo "${ED} - <<\EOT"; \ 54 echo H; \ 55 echo "r $t.err"; \ 56 cat $t.err; \ 57 echo "w $t.o"; \ 58 echo EOT; \ 59 ) >$t.tmp 60 mv $t.tmp $t.red 61 chmod +x $t.red 62 63REGRESS_TARGETS += run-$t.red 64# from /usr/src/bin/ed/test/ckscripts.sh, converted to make rule 65run-$t.red: $t.red 66 @echo '======== $@ ========' 67 ! ./$t.red 68.endfor 69 70.include <bsd.regress.mk> 71