summaryrefslogtreecommitdiff
path: root/regress/usr.bin/sed/Makefile
blob: 47f9871f9686a4b693a0dd28cdf1f6ed1846f784 (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
67
68
69
#	$OpenBSD: Makefile,v 1.7 2017/07/06 14:17:11 bluhm Exp $
#	$NetBSD: Makefile,v 1.1 2005/04/04 16:48:45 peter Exp $

SED?=	/usr/bin/sed

REGRESS_TARGETS= sedtest substitute hanoi math sierpinski negation \
	inplace inplace2 inplace3 commandl1 commandl2 commandc1 commandD1

commandl1 commandl2 commandc1 commandD1:
	# New tests, currently failing, need fixes in sed.
	@echo DISABLED

sedtest:
	sh ${.CURDIR}/$@.sh ${SED} $@.out
	diff ${.CURDIR}/$@.expected $@.out

substitute:
	sh ${.CURDIR}/$@.sh

hanoi:
	${SED} -f ${.CURDIR}/$@.sed ${.CURDIR}/$@.in > $@.out
	diff ${.CURDIR}/$@.expected $@.out

math:
	${SED} -f ${.CURDIR}/$@.sed ${.CURDIR}/$@.in > $@.out
	diff ${.CURDIR}/$@.expected $@.out

sierpinski:
	${SED} -nf ${.CURDIR}/$@.sed ${.CURDIR}/$@.in > $@.out
	diff ${.CURDIR}/$@.expected $@.out

negation:
	echo foo | ${SED} "1!!s/foo/bar/" > $@.out
	diff ${.CURDIR}/$@.expected $@.out

inplace:
	cp -f ${.CURDIR}/$@.in $@.txt
	${SED} -i -f ${.CURDIR}/sierpinski.sed $@.txt
	diff ${.CURDIR}/sierpinski.expected $@.txt

inplace2:
	cp -f ${.CURDIR}/$@.in $@.txt
	${SED} -i 's/PROG/GROP/g' $@.txt
	diff ${.CURDIR}/$@.expected $@.txt

inplace3:
	cp -f ${.CURDIR}/$@.in $@.txt
	${SED} -i 's/#PermitRootLogin no/PermitRootLogin yes/g' $@.txt
	diff ${.CURDIR}/$@.expected $@.txt

commandl1:
	printf 'a\nbb\n' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
	diff ${.CURDIR}/$@.expected $@.out

commandl2:
	printf 'abc' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
	diff ${.CURDIR}/$@.expected $@.out

commandc1:
	printf 'abc' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
	diff ${.CURDIR}/$@.expected $@.out

commandD1:
	printf 'a\nbb\n' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
	diff ${.CURDIR}/$@.expected $@.out

CLEANFILES+=*.out lines* script* *.txt

.include <bsd.regress.mk>