Makefile revision 216468
1159097Smaxim# $FreeBSD: head/tools/regression/execve/Makefile 163153 2006-10-09 06:47:08Z maxim $
2159097Smaxim
3159097SmaximPROG=	doexec
4159097SmaximNO_MAN=
5159097Smaxim
6159097SmaximRP=	./${PROG}
7159097SmaximTD=	${.CURDIR}/tests
8159097Smaxim
9159097SmaximTESTSCRIPTS=	nonexistshell devnullscript badinterplen goodscript \
10159097Smaxim		scriptarg scriptarg-nospace
11163153SmaximCLEANFILES=	goodaout truncaout sparseaout empty ${TESTSCRIPTS}
12159097Smaxim
13159097Smaximall:		${PROG} goodaout ${TESTSCRIPTS}
14159097Smaxim
15159097Smaxim.for x in ${TESTSCRIPTS}
16159097Smaxim${x}: ${TD}/${x}
17159097Smaxim	cp ${TD}/${x} .
18159097Smaxim	chmod +x ${x}
19159097Smaxim.endfor
20159097Smaxim
21159097Smaximregress:	test-empty test-nonexist test-nonexistshell \
22159097Smaxim		test-devnullscript test-badinterplen test-goodscript \
23159097Smaxim		test-scriptarg test-scriptarg-nospace test-goodaout \
24163153Smaxim		test-truncaout test-sparseaout
25159097Smaxim
26159097Smaximtest-empty:	${PROG}
27159097Smaxim	rm -f empty
28159097Smaxim	touch empty
29159097Smaxim	chmod +x empty
30159098Smaxim	${RP} empty | grep 'Exec format error'
31159097Smaxim
32159097Smaximtest-nonexist:	${PROG}
33159097Smaxim	${RP} ${TD}/nonexistent | grep 'No such file or directory'
34159097Smaxim
35159097Smaximtest-nonexistshell: ${PROG} nonexistshell
36159097Smaxim	${RP} nonexistshell | grep 'No such file or directory'
37159097Smaxim
38159097Smaximtest-devnullscript: ${PROG} devnullscript
39159097Smaxim	${RP} devnullscript | grep 'Permission denied'
40159097Smaxim
41159097Smaximtest-badinterplen: ${PROG} badinterplen
42159097Smaxim	${RP} badinterplen | grep 'No such file or directory'
43159097Smaxim
44159097Smaximtest-goodscript: ${PROG} goodscript
45159097Smaxim	${RP} goodscript | grep 'succeeded'
46159097Smaxim
47159097Smaximtest-scriptarg: ${PROG} scriptarg
48159097Smaxim	${RP} scriptarg 2>&1 | grep '+ echo succeeded'
49159097Smaxim
50159097Smaximtest-scriptarg-nospace: ${PROG} scriptarg-nospace
51159097Smaxim	${RP} scriptarg-nospace 2>&1 | grep '+ echo succeeded'
52159097Smaxim
53159097Smaximgoodaout: ${TD}/goodaout.c
54159097Smaxim	${CC} -static -o ${.TARGET} ${TD}/goodaout.c
55159097Smaxim
56159097Smaximtest-goodaout: ${PROG} goodaout
57159097Smaxim	${RP} goodaout | grep 'succeeded'
58159097Smaxim
59159097Smaximtest-truncaout: ${PROG} goodaout
60159097Smaxim	truncate -s 16 truncaout
61159097Smaxim	chmod a+x truncaout
62159097Smaxim	${RP} truncaout | grep 'Exec format error'
63159097Smaxim
64163153Smaximtest-sparseaout: ${PROG}
65163153Smaxim	/bin/rm -rf sparseaout
66163153Smaxim	truncate -s 20480 sparseaout
67163153Smaxim	chmod a+x sparseaout
68163153Smaxim	${RP} sparseaout | grep 'Exec format error'
69159097Smaxim
70159097Smaxim.include <bsd.prog.mk>
71