xref: /openbsd/regress/usr.bin/sed/Makefile (revision d02a8fbe)
1*d02a8fbeSbluhm#	$OpenBSD: Makefile,v 1.7 2017/07/06 14:17:11 bluhm Exp $
214274383Smillert#	$NetBSD: Makefile,v 1.1 2005/04/04 16:48:45 peter Exp $
314274383Smillert
4e47cfd50SjasperSED?=	/usr/bin/sed
514274383Smillert
6e47cfd50SjasperREGRESS_TARGETS= sedtest substitute hanoi math sierpinski negation \
7f297b04dSotto	inplace inplace2 inplace3 commandl1 commandl2 commandc1 commandD1
8cd65ed77Smillert
9*d02a8fbeSbluhmcommandl1 commandl2 commandc1 commandD1:
10*d02a8fbeSbluhm	# New tests, currently failing, need fixes in sed.
11*d02a8fbeSbluhm	@echo DISABLED
12*d02a8fbeSbluhm
13cd65ed77Smillertsedtest:
14cd65ed77Smillert	sh ${.CURDIR}/$@.sh ${SED} $@.out
15cd65ed77Smillert	diff ${.CURDIR}/$@.expected $@.out
16cd65ed77Smillert
172e665b55Sschwarzesubstitute:
182e665b55Sschwarze	sh ${.CURDIR}/$@.sh
192e665b55Sschwarze
20cd65ed77Smillerthanoi:
21cd65ed77Smillert	${SED} -f ${.CURDIR}/$@.sed ${.CURDIR}/$@.in > $@.out
22cd65ed77Smillert	diff ${.CURDIR}/$@.expected $@.out
23cd65ed77Smillert
24cd65ed77Smillertmath:
25cd65ed77Smillert	${SED} -f ${.CURDIR}/$@.sed ${.CURDIR}/$@.in > $@.out
26cd65ed77Smillert	diff ${.CURDIR}/$@.expected $@.out
27cd65ed77Smillert
28cd65ed77Smillertsierpinski:
29cd65ed77Smillert	${SED} -nf ${.CURDIR}/$@.sed ${.CURDIR}/$@.in > $@.out
30cd65ed77Smillert	diff ${.CURDIR}/$@.expected $@.out
3114274383Smillert
3245d46768Smillertnegation:
3345d46768Smillert	echo foo | ${SED} "1!!s/foo/bar/" > $@.out
3445d46768Smillert	diff ${.CURDIR}/$@.expected $@.out
3545d46768Smillert
36e47cfd50Sjasperinplace:
37e47cfd50Sjasper	cp -f ${.CURDIR}/$@.in $@.txt
38e47cfd50Sjasper	${SED} -i -f ${.CURDIR}/sierpinski.sed $@.txt
39e47cfd50Sjasper	diff ${.CURDIR}/sierpinski.expected $@.txt
40e47cfd50Sjasper
41e47cfd50Sjasperinplace2:
42e47cfd50Sjasper	cp -f ${.CURDIR}/$@.in $@.txt
43e47cfd50Sjasper	${SED} -i 's/PROG/GROP/g' $@.txt
44e47cfd50Sjasper	diff ${.CURDIR}/$@.expected $@.txt
45e47cfd50Sjasper
46e47cfd50Sjasperinplace3:
47e47cfd50Sjasper	cp -f ${.CURDIR}/$@.in $@.txt
48e47cfd50Sjasper	${SED} -i 's/#PermitRootLogin no/PermitRootLogin yes/g' $@.txt
49e47cfd50Sjasper	diff ${.CURDIR}/$@.expected $@.txt
50e47cfd50Sjasper
51f297b04dSottocommandl1:
52f297b04dSotto	printf 'a\nbb\n' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
53f297b04dSotto	diff ${.CURDIR}/$@.expected $@.out
54f297b04dSotto
55f297b04dSottocommandl2:
56f297b04dSotto	printf 'abc' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
57f297b04dSotto	diff ${.CURDIR}/$@.expected $@.out
58f297b04dSotto
59f297b04dSottocommandc1:
60f297b04dSotto	printf 'abc' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
61f297b04dSotto	diff ${.CURDIR}/$@.expected $@.out
62f297b04dSotto
63f297b04dSottocommandD1:
64f297b04dSotto	printf 'a\nbb\n' | ${SED} -f ${.CURDIR}/$@.sed > $@.out
65f297b04dSotto	diff ${.CURDIR}/$@.expected $@.out
66f297b04dSotto
67e47cfd50SjasperCLEANFILES+=*.out lines* script* *.txt
6814274383Smillert
6914274383Smillert.include <bsd.regress.mk>
70