Deleted Added
full compact
Makefile (159097) Makefile (159098)
1# $FreeBSD: head/tools/regression/execve/Makefile 159097 2006-05-31 11:13:10Z maxim $
1# $FreeBSD: head/tools/regression/execve/Makefile 159098 2006-05-31 11:15:16Z maxim $
2
3PROG= doexec
4NO_MAN=
5
6RP= ./${PROG}
7TD= ${.CURDIR}/tests
8OD= ${.CURDIR}/good
9
10TESTSCRIPTS= nonexistshell devnullscript badinterplen goodscript \
11 scriptarg scriptarg-nospace
12CLEANFILES= goodaout truncaout sparceaout empty ${TESTSCRIPTS}
13
14all: ${PROG} goodaout ${TESTSCRIPTS}
15
16.for x in ${TESTSCRIPTS}
17${x}: ${TD}/${x}
18 cp ${TD}/${x} .
19 chmod +x ${x}
20.endfor
21
22regress: test-empty test-nonexist test-nonexistshell \
23 test-devnullscript test-badinterplen test-goodscript \
24 test-scriptarg test-scriptarg-nospace test-goodaout \
25 test-truncaout test-sparceaout
26
27test-empty: ${PROG}
28 rm -f empty
29 touch empty
30 chmod +x empty
2
3PROG= doexec
4NO_MAN=
5
6RP= ./${PROG}
7TD= ${.CURDIR}/tests
8OD= ${.CURDIR}/good
9
10TESTSCRIPTS= nonexistshell devnullscript badinterplen goodscript \
11 scriptarg scriptarg-nospace
12CLEANFILES= goodaout truncaout sparceaout empty ${TESTSCRIPTS}
13
14all: ${PROG} goodaout ${TESTSCRIPTS}
15
16.for x in ${TESTSCRIPTS}
17${x}: ${TD}/${x}
18 cp ${TD}/${x} .
19 chmod +x ${x}
20.endfor
21
22regress: test-empty test-nonexist test-nonexistshell \
23 test-devnullscript test-badinterplen test-goodscript \
24 test-scriptarg test-scriptarg-nospace test-goodaout \
25 test-truncaout test-sparceaout
26
27test-empty: ${PROG}
28 rm -f empty
29 touch empty
30 chmod +x empty
31 ${RP} empty | diff ${OD}/empty -
31 ${RP} empty | grep 'Exec format error'
32
33test-nonexist: ${PROG}
34 ${RP} ${TD}/nonexistent | grep 'No such file or directory'
35
36test-nonexistshell: ${PROG} nonexistshell
37 ${RP} nonexistshell | grep 'No such file or directory'
38
39test-devnullscript: ${PROG} devnullscript
40 ${RP} devnullscript | grep 'Permission denied'
41
42test-badinterplen: ${PROG} badinterplen
43 ${RP} badinterplen | grep 'No such file or directory'
44
45test-goodscript: ${PROG} goodscript
46 ${RP} goodscript | grep 'succeeded'
47
48test-scriptarg: ${PROG} scriptarg
49 ${RP} scriptarg 2>&1 | grep '+ echo succeeded'
50
51test-scriptarg-nospace: ${PROG} scriptarg-nospace
52 ${RP} scriptarg-nospace 2>&1 | grep '+ echo succeeded'
53
54goodaout: ${TD}/goodaout.c
55 ${CC} -static -o ${.TARGET} ${TD}/goodaout.c
56
57test-goodaout: ${PROG} goodaout
58 ${RP} goodaout | grep 'succeeded'
59
60test-truncaout: ${PROG} goodaout
61 truncate -s 16 truncaout
62 chmod a+x truncaout
63 ${RP} truncaout | grep 'Exec format error'
64
65test-sparceaout: ${PROG}
66 /bin/rm -rf sparceaout
67 truncate -s 20480 sparceaout
68 chmod a+x sparceaout
69 ${RP} sparceaout | grep 'Exec format error'
70
71.include <bsd.prog.mk>
32
33test-nonexist: ${PROG}
34 ${RP} ${TD}/nonexistent | grep 'No such file or directory'
35
36test-nonexistshell: ${PROG} nonexistshell
37 ${RP} nonexistshell | grep 'No such file or directory'
38
39test-devnullscript: ${PROG} devnullscript
40 ${RP} devnullscript | grep 'Permission denied'
41
42test-badinterplen: ${PROG} badinterplen
43 ${RP} badinterplen | grep 'No such file or directory'
44
45test-goodscript: ${PROG} goodscript
46 ${RP} goodscript | grep 'succeeded'
47
48test-scriptarg: ${PROG} scriptarg
49 ${RP} scriptarg 2>&1 | grep '+ echo succeeded'
50
51test-scriptarg-nospace: ${PROG} scriptarg-nospace
52 ${RP} scriptarg-nospace 2>&1 | grep '+ echo succeeded'
53
54goodaout: ${TD}/goodaout.c
55 ${CC} -static -o ${.TARGET} ${TD}/goodaout.c
56
57test-goodaout: ${PROG} goodaout
58 ${RP} goodaout | grep 'succeeded'
59
60test-truncaout: ${PROG} goodaout
61 truncate -s 16 truncaout
62 chmod a+x truncaout
63 ${RP} truncaout | grep 'Exec format error'
64
65test-sparceaout: ${PROG}
66 /bin/rm -rf sparceaout
67 truncate -s 20480 sparceaout
68 chmod a+x sparceaout
69 ${RP} sparceaout | grep 'Exec format error'
70
71.include <bsd.prog.mk>