summaryrefslogtreecommitdiff
path: root/regress/bin/ed/Makefile
blob: a4654d502da92f5836588dda39c5f082fb4f598c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# $OpenBSD: Makefile,v 1.3 2020/12/17 00:51:11 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

# from /usr/src/bin/ed/test/README, known failing tests
REGRESS_EXPECTED_FAILURES =	run-eq.red \
				run-a1.red \
				run-i1.red \
				run-k1.red \
				run-r1.red

REGRESS_TARGETS =

.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
	cp ${TESTDIR}/$t.t ${TESTDIR}/$t.d .
	( \
	    echo "#!/bin/sh -"; \
	    echo "rm -f -- $t.o"; \
	    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-$t.ed
# from /usr/src/bin/ed/test/ckscripts.sh, converted to make rule
run-$t.ed: $t.ed
	./$t.ed
	diff -u ${TESTDIR}/$t.r $t.o
.endfor

.for t in ${ERRS:R}
# from /usr/src/bin/ed/test/mkscripts.sh, converted to make rule
$t.red: ${TESTDIR}/$t.err Makefile
	cp ${TESTDIR}/$t.err .
	( \
	    echo "#!/bin/sh -"; \
	    echo "rm -f -- $t.o"; \
	    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-$t.red
# from /usr/src/bin/ed/test/ckscripts.sh, converted to make rule
run-$t.red: $t.red
	! ./$t.red
.endfor

.include <bsd.regress.mk>