xref: /openbsd/regress/sys/kern/execve/Makefile (revision 8b1f9e10)
1*8b1f9e10Savsm#	$OpenBSD: Makefile,v 1.5 2002/09/02 20:01:44 avsm Exp $
2df930be7Sderaadt
3df930be7SderaadtPROG=	doexec
4df930be7SderaadtLDSTATIC= -static
5df930be7Sderaadt
6df930be7SderaadtRP=	${.OBJDIR}/${PROG}
7df930be7SderaadtTD=	${.CURDIR}/tests
8df930be7SderaadtOD=	${.CURDIR}/good
9df930be7Sderaadt
106438b65fSmillertTESTFILES= empty nonexistshell devnullscript badinterplen goodscript \
116438b65fSmillert	   scriptarg scriptarg-nospace goodaout truncaout
126438b65fSmillert
136438b65fSmillertCLEANFILES+= ${TESTFILES}
146438b65fSmillert
156438b65fSmillertall:	${PROG} ${TESTFILES}
16df930be7Sderaadt
17*8b1f9e10SavsmREGRESS_TARGETS=	test-empty test-nonexist \
18df930be7Sderaadt		test-nonexistshell test-devnullscript test-badinterplen \
19df930be7Sderaadt		test-goodscript test-scriptarg test-scriptarg-nospace \
20df930be7Sderaadt		test-goodaout test-truncaout
21df930be7Sderaadt
226438b65fSmillertempty: ${TD}/empty.in
236438b65fSmillert	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
246438b65fSmillert
256438b65fSmillerttest-empty:	${PROG} empty
26daff61b3Sangelos	${RP} ${.OBJDIR}/empty | diff - ${OD}/empty
27df930be7Sderaadt
286438b65fSmillertnonexist: ${TD}/nonexist.in
296438b65fSmillert	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
30df930be7Sderaadt
316438b65fSmillerttest-nonexist:	${PROG}
326438b65fSmillert	${RP} ${.OBJDIR}/nonexistent | diff - ${OD}/nonexistent
336438b65fSmillert
346438b65fSmillertnonexistshell: ${TD}/nonexistshell.in
356438b65fSmillert	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
366438b65fSmillert
376438b65fSmillerttest-nonexistshell: ${PROG} nonexistshell
38daff61b3Sangelos	${RP} ${.OBJDIR}/nonexistshell | diff - ${OD}/nonexistshell
39df930be7Sderaadt
406438b65fSmillertdevnullscript: ${TD}/devnullscript.in
416438b65fSmillert	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
426438b65fSmillert
436438b65fSmillerttest-devnullscript: ${PROG} devnullscript
44daff61b3Sangelos	${RP} ${.OBJDIR}/devnullscript | diff - ${OD}/devnullscript
45df930be7Sderaadt
466438b65fSmillertbadinterplen: ${TD}/badinterplen.in
476438b65fSmillert	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
486438b65fSmillert
496438b65fSmillerttest-badinterplen: ${PROG} badinterplen
50daff61b3Sangelos	${RP} ${.OBJDIR}/badinterplen | diff - ${OD}/badinterplen
51df930be7Sderaadt
526438b65fSmillertgoodscript: ${TD}/goodscript.in
536438b65fSmillert	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
546438b65fSmillert
556438b65fSmillerttest-goodscript: ${PROG} goodscript
56daff61b3Sangelos	${RP} ${.OBJDIR}/goodscript | diff - ${OD}/goodscript
57df930be7Sderaadt
586438b65fSmillertscriptarg: ${TD}/scriptarg.in
596438b65fSmillert	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
606438b65fSmillert
616438b65fSmillerttest-scriptarg: ${PROG} scriptarg
62daff61b3Sangelos	${RP} ${.OBJDIR}/scriptarg 2>&1 | diff - ${OD}/scriptarg
63df930be7Sderaadt
646438b65fSmillertscriptarg-nospace: ${TD}/scriptarg-nospace.in
656438b65fSmillert	${INSTALL} -c -m 755 ${.ALLSRC} ${.TARGET}
666438b65fSmillert
676438b65fSmillerttest-scriptarg-nospace: ${PROG} scriptarg-nospace
68daff61b3Sangelos	${RP} ${.OBJDIR}/scriptarg-nospace 2>&1 | diff - ${OD}/scriptarg-nospace
69df930be7Sderaadt
70df930be7Sderaadtgoodaout: ${TD}/goodaout.c
71df930be7Sderaadt	${LINK.c} ${LDSTATIC} -o ${.TARGET} ${TD}/goodaout.c ${LDLIBS}
72df930be7Sderaadt
73df930be7Sderaadttest-goodaout: ${PROG} goodaout
74df930be7Sderaadt	${RP} ${.OBJDIR}/goodaout | diff - ${OD}/goodaout
75df930be7Sderaadt
76df930be7Sderaadttruncaout: goodaout
77df930be7Sderaadt	/bin/rm -rf truncaout
78df930be7Sderaadt	dd if=${.OBJDIR}/goodaout of=truncaout bs=16 count=1
796438b65fSmillert	chmod a+x truncaout
80df930be7Sderaadt
81df930be7Sderaadttest-truncaout: ${PROG} truncaout
82df930be7Sderaadt	${RP} ${.OBJDIR}/truncaout | diff - ${OD}/truncaout
83df930be7Sderaadt
84fd84ef7eSart.include <bsd.regress.mk>
85