xref: /openbsd/regress/usr.bin/make/Makefile (revision 02e33fd6)
1*02e33fd6Sespie# $OpenBSD: Makefile,v 1.44 2017/01/29 10:03:09 espie Exp $
2d30492b3Sespie
33846517aSespie# We don't pass t7, t13, t14, t17, t19, t20 t21 t26
49280f092Sespie# and t16 yields piss poor performance
532a92205SespieREGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 \
632a92205Sespie	t13 t14 t15 t16 t17 t18 t19 t20 t21 t22 t23 t24 \
732a92205Sespie	t25 t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 \
8*02e33fd6Sespie	t37 t38 t38j t39 t40 t41 t42 t43 t44 t45 t46
9d30492b3Sespie
10777589e1StbMALLOC_OPTIONS?=J
11d30492b3Sespiet1: t1.out
12fe973566Sespie	env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -e -r -f ${.CURDIR}/mk1 | diff - t1.out
13d30492b3Sespie
14d30492b3Sespie
15d30492b3Sespie# This is a POSIX test. pmake does not pass variables to submakes until
16d30492b3Sespie# after OpenBSD 2.7.
17d30492b3Sespiet2:
18fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk2| diff - t2.out
19d30492b3Sespie
20d30492b3Sespiet3:
21fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk3 -f mk3a|diff - t3.out
22fe973566Sespie	cd ${.CURDIR} && cat mk3a |env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk3 -f -|diff - t3.out
23fe973566Sespie	cd ${.CURDIR} && cat mk3 |env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - -f mk3a|diff - t3.out
24fe973566Sespie	cd ${.CURDIR} && cat mk3 mk3a|env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - |diff - t3.out
25d30492b3Sespie
26d30492b3Sespiet4:
27fe973566Sespie	cd ${.CURDIR} && cat mk4 mk4a|env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - |diff - t4.out
28d30492b3Sespie	# Splitting files along conditionals should not work
291524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk4 -f mk4a 2>/dev/null || test $$? -ge 128 ; then false; fi
30d30492b3Sespie
31d30492b3Sespie# Another POSIX test, checking that MAKEFLAGS does work
32d30492b3Sespiet5:
33d30492b3Sespie	# first check that make does fail as expected
341524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mkfail 2>/dev/null || test $$? -ge 128; then false; fi
35d30492b3Sespie	# first form of MAKEFLAGS
36fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MAKEFLAGS=-n MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mkfail
37d30492b3Sespie	# second form of MAKEFLAGS
38fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MAKEFLAGS=n MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mkfail
39d30492b3Sespie
40d30492b3Sespiet6:
41fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} A=good -r -f mk6 | diff - t6.out
42d30492b3Sespie
43300b6ef0Sespie# This test currently fails, and will until the cond parser is rewritten.
441a5be1c1Sespiet7:
451524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk7 2>/dev/null || test $$? -ge 128; then false; fi
461a5be1c1Sespie
479e90d608Sespie# check for existent/non existent files
489e90d608Sespiet8:
499e90d608Sespie	touch goodfile phony
50fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk8 | diff - t8.out
519e90d608Sespie
523a482e43Sespiet9:
53fe973566Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk9 2>&1 | diff - t9.out
543a482e43Sespie
55a3ee128fSespie# verify that systemV extended variables work as expected
56a3ee128fSespiet10:	z.a
57a3ee128fSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk10 |diff - t10.out
58a3ee128fSespie
59da5327dbSespie# check for substitution parser in some confusing situations
60da5327dbSespiet11:
61da5327dbSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk11 |diff - t11.out
62da5327dbSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk11 A=t|diff - t11.out2
63da5327dbSespie
6400a5c933Sespie# Check for filename expansions.
6500a5c933Sespiet12:
6600a5c933Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk12 |diff - t12.out
6700a5c933Sespie
68ea40f178Sespie# Verify whitespace handling. Currently failing.
69ea40f178Sespiet13:
70ea40f178Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk13 |diff - t13.out
71ea40f178Sespie
72fcb573ceSespiet14:
731524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk14 2>/dev/null || test $$? -ge 128; then false; fi
74fcb573ceSespie
75ad977213Sespiet15:
76ad977213Sespie	touch t15file
77ad977213Sespie	cd ${.CURDIR} && ulimit -t 2 && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk15 2>/dev/null
78ad977213Sespie
796e31152dSespiet16:
806e31152dSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk16
816e31152dSespie
829280f092Sespiet17:
839280f092Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk17
849280f092Sespie
85b2734408Sespiet18:
86b2734408Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk18
87b2734408Sespie
8882eabe46Sespiet19:
8982eabe46Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} SHELL=/bin/zsh ${MAKE} -r -f mk19 | diff - t19.out
9082eabe46Sespie
9182eabe46Sespiet20:
9282eabe46Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk20 | diff - t20.out
9382eabe46Sespie
949fdcdc49Sespiet21:
959fdcdc49Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk21 | diff - t21.out
969fdcdc49Sespie
97a00f81f1Sespiet22:
98a00f81f1Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk22 b | diff - t22.out
99a00f81f1Sespie
100a00f81f1Sespiet23:
101a00f81f1Sespie	cd ${.CURDIR} && ulimit -t 60 && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk22 a 2>&1| diff - t23.out
102a00f81f1Sespie
103d8547688Sespiet24:
1041524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk23 a 2>/dev/null || test $$? -ge 128; then false; fi
1053846517aSespie
1063846517aSespiet25:
1073846517aSespie	touch ${.OBJDIR}/t25.1st
1083846517aSespie	rm -f ${.OBJDIR}/t25.2nd
1091524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk24 t25.2nd 2>/dev/null || test $$? -ge 128; then false; fi
1103846517aSespie
1113846517aSespiet26:
1123846517aSespie	touch ${.OBJDIR}/f26.2nd
1133846517aSespie	rm -f ${.OBJDIR}/f26
1141524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk24 f26 2>/dev/null || test $$? -ge 128; then false; fi
1153846517aSespie
1163846517aSespiet27:
1173846517aSespie	touch ${.OBJDIR}/t27.2nd
1183846517aSespie	rm -f ${.OBJDIR}/t27.3rd
1191524cffdSespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk24 t27.3rd 2>/dev/null || test $$? -ge 128; then false; fi
120d8547688Sespie
1217ad4da04Sespiet28:
1227ad4da04Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk25 all >/dev/null
1237ad4da04Sespie
1243cd197acSespiet29:
1253cd197acSespie	rm -f t29dep t29.targ t29.targ2 libt29.a
1263cd197acSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk26 all | diff - t29.out
1273cd197acSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk26 all | diff - t29.out2
1283cd197acSespie
1297b923527Sespiet30:
1307b923527Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk27 all | diff - t30.out
1317b923527Sespie
132c235aa79Sespiet31:
133c235aa79Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk28 all
134c235aa79Sespie
135016739e4Sfgscht32:
136016739e4Sfgsch	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B="A" ${MAKE} -r -f mk32 all | diff - t32.out
137016739e4Sfgsch
138016739e4Sfgscht33:
139016739e4Sfgsch	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=0 ${MAKE} -r -f mk32 all | diff - t33.out
140016739e4Sfgsch
141016739e4Sfgscht34:
142016739e4Sfgsch	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=1 ${MAKE} -r -f mk32 all | diff - t34.out
143016739e4Sfgsch
144016739e4Sfgscht35:
145016739e4Sfgsch	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=2 ${MAKE} -r -f mk32 all | diff - t35.out
146016739e4Sfgsch
14778e70fa1Sespiet36:
14878e70fa1Sespie	if echo '$$$$(A:&)' | env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f - 2>/dev/null|| test $$? -ge 128; then false; fi
14978e70fa1Sespie
150a3ee128fSespiez.a:
151a3ee128fSespie	touch $@
152a3ee128fSespie
15350cd2f97Sespiet37:
154834049f1Sespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} B=2 ${MAKE} -r -f mk33 all; then false; else true; fi
15550cd2f97Sespie
15632a92205Sespiet38:
1574cc8d355Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk34 | diff - t38.out
15832a92205Sespie
15932a92205Sespiet38j:
1604cc8d355Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk34 -j2 | diff - t38.out
1614cc8d355Sespie
1624cc8d355Sespiet39:
1634cc8d355Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk35 2>&1 | diff - t39.out
1644cc8d355Sespie
165dacceb69Sjsgt40:
166dacceb69Sjsg	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk36 2>/dev/null
167dacceb69Sjsg
1689a59c451Sjsgt41:
1699a59c451Sjsg	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk37 2>/dev/null || test $$? -ge 128; then false; fi
1709a59c451Sjsg
1719a59c451Sjsgt42:
1729a59c451Sjsg	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk38 2>/dev/null || test $$? -ge 128; then false; fi
1739a59c451Sjsg
17461bf719dSespiet43:
17561bf719dSespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -j2 -f mk39 b 2>&1 | diff - t43.out
17604411d86Sespie	cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -j2 -f mk39 a 2>&1 | diff - t43.out
17761bf719dSespie
1783516c9d9Sespiet44:
1793516c9d9Sespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk40 2>/dev/null || test $$? -ge 128; then false; fi
1803516c9d9Sespie
1813516c9d9Sespiet45:
1823516c9d9Sespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk41 2>/dev/null || test $$? -ge 128; then false; fi
1833516c9d9Sespie
184*02e33fd6Sespie# this file should fail, but NOT segfault
185*02e33fd6Sespiet46:
186*02e33fd6Sespie	if cd ${.CURDIR} && env -i PATH=${PATH} MALLOC_OPTIONS=${MALLOC_OPTIONS} ${MAKE} -r -f mk42 a 2>/dev/null; then \
187*02e33fd6Sespie	    false; \
188*02e33fd6Sespie	    else \
189*02e33fd6Sespie		if test $$? -ge 1 -a $$? -lt 128; then \
190*02e33fd6Sespie		    true; else \
191*02e33fd6Sespie		    false; fi; \
192*02e33fd6Sespie	    fi
19361bf719dSespie
194d30492b3Sespiet1.out:
195d30492b3Sespie	echo MACHINE_ARCH=${MACHINE_ARCH} >$@
196d30492b3Sespie
1973846517aSespie.PHONY: ${REGRESS_TARGETS} regress
198d30492b3Sespie
19932a92205SespieCLEANFILES+=t1.out z.a a.a a.b mk34.b goodfile phony t15file \
2003cd197acSespie	t25.1st t25.2nd f26.2nd f26 t27.2nd t27.3rd \
2013cd197acSespie	libt29.a t29dep t29.targ t29.targ2
202d30492b3Sespie
2038267faadSart.include <bsd.regress.mk>
204