xref: /freebsd/usr.bin/bmake/unit-tests/Makefile (revision e2eeea75eb8b6dd50c1298067a0655880d186734)
1# This is a generated file, do NOT edit!
2# See contrib/bmake/bsd.after-import.mk
3#
4# $FreeBSD$
5# $Id: Makefile,v 1.115 2020/11/18 04:01:07 sjg Exp $
6#
7# $NetBSD: Makefile,v 1.206 2020/11/18 01:12:00 sjg Exp $
8#
9# Unit tests for make(1)
10#
11# The main targets are:
12#
13# all:
14#	run all the tests
15# test:
16#	run 'all', and compare to expected results
17# accept:
18#	move generated output to expected results
19#
20# Settable variables
21#
22# TEST_MAKE
23#	The make program to be tested.
24#
25#
26# Adding a test case
27#
28# Each feature should get its own set of tests in its own suitably
29# named makefile (*.mk), with its own set of expected results (*.exp),
30# and it should be added to the TESTS list.
31#
32# A few *.mk files are helper files for other tests (such as include-sub.mk)
33# and are thus not added to TESTS.  Such files must be ignored in
34# src/tests/usr.bin/make/t_make.sh.
35#
36
37# Each test is in a sub-makefile.
38# Keep the list sorted.
39# Any test that is commented out must be ignored in
40# src/tests/usr.bin/make/t_make.sh as well.
41#TESTS+=		archive
42TESTS+=		archive-suffix
43TESTS+=		cmd-errors
44TESTS+=		cmd-errors-lint
45TESTS+=		cmd-interrupt
46TESTS+=		cmdline
47TESTS+=		cmdline-undefined
48TESTS+=		comment
49TESTS+=		cond-cmp-numeric
50TESTS+=		cond-cmp-numeric-eq
51TESTS+=		cond-cmp-numeric-ge
52TESTS+=		cond-cmp-numeric-gt
53TESTS+=		cond-cmp-numeric-le
54TESTS+=		cond-cmp-numeric-lt
55TESTS+=		cond-cmp-numeric-ne
56TESTS+=		cond-cmp-string
57TESTS+=		cond-cmp-unary
58TESTS+=		cond-func
59TESTS+=		cond-func-commands
60TESTS+=		cond-func-defined
61TESTS+=		cond-func-empty
62TESTS+=		cond-func-exists
63TESTS+=		cond-func-make
64TESTS+=		cond-func-target
65TESTS+=		cond-late
66TESTS+=		cond-op
67TESTS+=		cond-op-and
68TESTS+=		cond-op-and-lint
69TESTS+=		cond-op-not
70TESTS+=		cond-op-or
71TESTS+=		cond-op-or-lint
72TESTS+=		cond-op-parentheses
73TESTS+=		cond-short
74TESTS+=		cond-token-number
75TESTS+=		cond-token-plain
76TESTS+=		cond-token-string
77TESTS+=		cond-token-var
78TESTS+=		cond-undef-lint
79TESTS+=		cond1
80TESTS+=		counter
81TESTS+=		counter-append
82TESTS+=		dep
83TESTS+=		dep-colon
84TESTS+=		dep-colon-bug-cross-file
85TESTS+=		dep-double-colon
86TESTS+=		dep-double-colon-indep
87TESTS+=		dep-exclam
88TESTS+=		dep-none
89TESTS+=		dep-percent
90TESTS+=		dep-var
91TESTS+=		dep-wildcards
92TESTS+=		depsrc
93TESTS+=		depsrc-end
94TESTS+=		depsrc-exec
95TESTS+=		depsrc-ignore
96TESTS+=		depsrc-made
97TESTS+=		depsrc-make
98TESTS+=		depsrc-meta
99TESTS+=		depsrc-nometa
100TESTS+=		depsrc-nometa_cmp
101TESTS+=		depsrc-nopath
102TESTS+=		depsrc-notmain
103TESTS+=		depsrc-optional
104TESTS+=		depsrc-phony
105TESTS+=		depsrc-precious
106TESTS+=		depsrc-recursive
107TESTS+=		depsrc-silent
108TESTS+=		depsrc-use
109TESTS+=		depsrc-usebefore
110TESTS+=		depsrc-usebefore-double-colon
111TESTS+=		depsrc-wait
112TESTS+=		deptgt
113TESTS+=		deptgt-begin
114TESTS+=		deptgt-default
115TESTS+=		deptgt-delete_on_error
116TESTS+=		deptgt-end
117TESTS+=		deptgt-end-jobs
118TESTS+=		deptgt-error
119TESTS+=		deptgt-ignore
120TESTS+=		deptgt-interrupt
121TESTS+=		deptgt-main
122TESTS+=		deptgt-makeflags
123TESTS+=		deptgt-no_parallel
124TESTS+=		deptgt-nopath
125TESTS+=		deptgt-notparallel
126TESTS+=		deptgt-objdir
127TESTS+=		deptgt-order
128TESTS+=		deptgt-path
129TESTS+=		deptgt-path-suffix
130TESTS+=		deptgt-phony
131TESTS+=		deptgt-precious
132TESTS+=		deptgt-shell
133TESTS+=		deptgt-silent
134TESTS+=		deptgt-stale
135TESTS+=		deptgt-suffixes
136TESTS+=		dir
137TESTS+=		dir-expand-path
138TESTS+=		directive
139TESTS+=		directive-dinclude
140TESTS+=		directive-elif
141TESTS+=		directive-elifdef
142TESTS+=		directive-elifmake
143TESTS+=		directive-elifndef
144TESTS+=		directive-elifnmake
145TESTS+=		directive-else
146TESTS+=		directive-endif
147TESTS+=		directive-error
148TESTS+=		directive-export
149TESTS+=		directive-export-env
150TESTS+=		directive-export-gmake
151TESTS+=		directive-export-literal
152TESTS+=		directive-for
153TESTS+=		directive-for-generating-endif
154TESTS+=		directive-hyphen-include
155TESTS+=		directive-if
156TESTS+=		directive-if-nested
157TESTS+=		directive-ifdef
158TESTS+=		directive-ifmake
159TESTS+=		directive-ifndef
160TESTS+=		directive-ifnmake
161TESTS+=		directive-include
162TESTS+=		directive-include-fatal
163TESTS+=		directive-info
164TESTS+=		directive-sinclude
165TESTS+=		directive-undef
166TESTS+=		directive-unexport
167TESTS+=		directive-unexport-env
168TESTS+=		directive-warning
169TESTS+=		dollar
170TESTS+=		doterror
171TESTS+=		dotwait
172TESTS+=		envfirst
173TESTS+=		error
174TESTS+=		# escape	# broken by reverting POSIX changes
175TESTS+=		export
176TESTS+=		export-all
177TESTS+=		export-env
178TESTS+=		export-variants
179TESTS+=		forloop
180TESTS+=		forsubst
181TESTS+=		gnode-submake
182TESTS+=		hanoi-include
183TESTS+=		impsrc
184TESTS+=		include-main
185TESTS+=		job-flags
186#TESTS+=		job-output-long-lines
187TESTS+=		lint
188TESTS+=		make-exported
189TESTS+=		moderrs
190TESTS+=		modmatch
191TESTS+=		modmisc
192TESTS+=		modts
193TESTS+=		modword
194TESTS+=		objdir-writable
195TESTS+=		opt
196TESTS+=		opt-backwards
197TESTS+=		opt-chdir
198TESTS+=		opt-debug
199TESTS+=		opt-debug-all
200TESTS+=		opt-debug-archive
201TESTS+=		opt-debug-curdir
202TESTS+=		opt-debug-cond
203TESTS+=		opt-debug-dir
204TESTS+=		opt-debug-errors
205TESTS+=		opt-debug-file
206TESTS+=		opt-debug-for
207TESTS+=		opt-debug-graph1
208TESTS+=		opt-debug-graph2
209TESTS+=		opt-debug-graph3
210TESTS+=		opt-debug-hash
211#TESTS+=		opt-debug-jobs
212TESTS+=		opt-debug-lint
213TESTS+=		opt-debug-loud
214TESTS+=		opt-debug-meta
215TESTS+=		opt-debug-making
216TESTS+=		opt-debug-no-rm
217TESTS+=		opt-debug-parse
218TESTS+=		opt-debug-suff
219TESTS+=		opt-debug-targets
220TESTS+=		opt-debug-varraw
221TESTS+=		opt-debug-var
222TESTS+=		opt-debug-x-trace
223TESTS+=		opt-define
224TESTS+=		opt-env
225TESTS+=		opt-file
226TESTS+=		opt-ignore
227TESTS+=		opt-include-dir
228TESTS+=		opt-jobs
229TESTS+=		opt-jobs-internal
230TESTS+=		opt-keep-going
231TESTS+=		opt-m-include-dir
232TESTS+=		opt-no-action
233TESTS+=		opt-no-action-at-all
234TESTS+=		opt-query
235TESTS+=		opt-raw
236TESTS+=		opt-silent
237TESTS+=		opt-touch
238TESTS+=		opt-touch-jobs
239TESTS+=		opt-tracefile
240TESTS+=		opt-var-expanded
241TESTS+=		opt-var-literal
242TESTS+=		opt-warnings-as-errors
243TESTS+=		opt-where-am-i
244TESTS+=		opt-x-reduce-exported
245TESTS+=		order
246TESTS+=		parse-var
247TESTS+=		phony-end
248TESTS+=		posix
249TESTS+=		# posix1	# broken by reverting POSIX changes
250TESTS+=		qequals
251TESTS+=		recursive
252TESTS+=		sh
253TESTS+=		sh-dots
254TESTS+=		sh-jobs
255TESTS+=		sh-jobs-error
256TESTS+=		sh-leading-at
257TESTS+=		sh-leading-hyphen
258TESTS+=		sh-leading-plus
259TESTS+=		sh-meta-chars
260TESTS+=		sh-multi-line
261TESTS+=		sh-single-line
262TESTS+=		shell-csh
263TESTS+=		shell-custom
264.if exists(/bin/ksh)
265TESTS+=		shell-ksh
266.endif
267TESTS+=		shell-sh
268TESTS+=		suff-add-later
269TESTS+=		suff-clear-regular
270TESTS+=		suff-clear-single
271TESTS+=		suff-lookup
272TESTS+=		suff-main
273TESTS+=		suff-rebuild
274TESTS+=		suff-self
275TESTS+=		suff-transform-endless
276TESTS+=		suff-transform-expand
277TESTS+=		suff-transform-select
278TESTS+=		sunshcmd
279TESTS+=		ternary
280TESTS+=		unexport
281TESTS+=		unexport-env
282TESTS+=		use-inference
283TESTS+=		var-class
284TESTS+=		var-class-cmdline
285TESTS+=		var-class-env
286TESTS+=		var-class-global
287TESTS+=		var-class-local
288TESTS+=		var-class-local-legacy
289TESTS+=		var-op
290TESTS+=		var-op-append
291TESTS+=		var-op-assign
292TESTS+=		var-op-default
293TESTS+=		var-op-expand
294TESTS+=		var-op-shell
295TESTS+=		var-op-sunsh
296TESTS+=		var-recursive
297TESTS+=		varcmd
298TESTS+=		vardebug
299TESTS+=		varfind
300TESTS+=		varmisc
301TESTS+=		varmod
302TESTS+=		varmod-assign
303TESTS+=		varmod-defined
304TESTS+=		varmod-edge
305TESTS+=		varmod-exclam-shell
306TESTS+=		varmod-extension
307TESTS+=		varmod-gmtime
308TESTS+=		varmod-hash
309TESTS+=		varmod-head
310TESTS+=		varmod-ifelse
311TESTS+=		varmod-l-name-to-value
312TESTS+=		varmod-localtime
313TESTS+=		varmod-loop
314TESTS+=		varmod-match
315TESTS+=		varmod-match-escape
316TESTS+=		varmod-no-match
317TESTS+=		varmod-order
318TESTS+=		varmod-order-reverse
319TESTS+=		varmod-order-shuffle
320TESTS+=		varmod-path
321TESTS+=		varmod-quote
322TESTS+=		varmod-quote-dollar
323TESTS+=		varmod-range
324TESTS+=		varmod-remember
325TESTS+=		varmod-root
326TESTS+=		varmod-select-words
327TESTS+=		varmod-shell
328TESTS+=		varmod-subst
329TESTS+=		varmod-subst-regex
330TESTS+=		varmod-sysv
331TESTS+=		varmod-tail
332TESTS+=		varmod-to-abs
333TESTS+=		varmod-to-lower
334TESTS+=		varmod-to-many-words
335TESTS+=		varmod-to-one-word
336TESTS+=		varmod-to-separator
337TESTS+=		varmod-to-upper
338TESTS+=		varmod-undefined
339TESTS+=		varmod-unique
340TESTS+=		varname
341TESTS+=		varname-dollar
342TESTS+=		varname-dot-alltargets
343TESTS+=		varname-dot-curdir
344TESTS+=		varname-dot-includes
345TESTS+=		varname-dot-includedfromdir
346TESTS+=		varname-dot-includedfromfile
347TESTS+=		varname-dot-libs
348TESTS+=		varname-dot-make-dependfile
349TESTS+=		varname-dot-make-expand_variables
350TESTS+=		varname-dot-make-exported
351TESTS+=		varname-dot-make-jobs
352TESTS+=		varname-dot-make-jobs-prefix
353TESTS+=		varname-dot-make-level
354TESTS+=		varname-dot-make-makefile_preference
355TESTS+=		varname-dot-make-makefiles
356TESTS+=		varname-dot-make-meta-bailiwick
357TESTS+=		varname-dot-make-meta-created
358TESTS+=		varname-dot-make-meta-files
359TESTS+=		varname-dot-make-meta-ignore_filter
360TESTS+=		varname-dot-make-meta-ignore_paths
361TESTS+=		varname-dot-make-meta-ignore_patterns
362TESTS+=		varname-dot-make-meta-prefix
363TESTS+=		varname-dot-make-mode
364TESTS+=		varname-dot-make-path_filemon
365TESTS+=		varname-dot-make-pid
366TESTS+=		varname-dot-make-ppid
367TESTS+=		varname-dot-make-save_dollars
368TESTS+=		varname-dot-makeoverrides
369TESTS+=		varname-dot-newline
370TESTS+=		varname-dot-objdir
371TESTS+=		varname-dot-parsedir
372TESTS+=		varname-dot-parsefile
373TESTS+=		varname-dot-path
374TESTS+=		varname-dot-shell
375TESTS+=		varname-dot-targets
376TESTS+=		varname-empty
377TESTS+=		varname-make
378TESTS+=		varname-make_print_var_on_error
379TESTS+=		varname-make_print_var_on_error-jobs
380TESTS+=		varname-makefile
381TESTS+=		varname-makeflags
382TESTS+=		varname-pwd
383TESTS+=		varname-vpath
384TESTS+=		varparse-dynamic
385TESTS+=		varparse-errors
386TESTS+=		varparse-mod
387TESTS+=		varparse-undef-partial
388TESTS+=		varquote
389
390# Ideas for more tests:
391#	char-0020-space.mk
392#	char-005C-backslash.mk
393#	escape-cond-str.mk
394#	escape-cond-func-arg.mk
395#	escape-cond-func-arg.mk
396#	escape-varmod.mk
397#	escape-varmod-define.mk
398#	escape-varmod-match.mk
399#	escape-varname.mk
400#	escape-varassign-varname.mk
401#	escape-varassign-varname-cmdline.mk
402#	escape-varassign-value.mk
403#	escape-varassign-value-cmdline.mk
404#	escape-dependency-source.mk
405#	escape-dependency-target.mk
406#	escape-for-varname.mk
407#	escape-for-item.mk
408#	posix-*.mk (see posix.mk and posix1.mk)
409
410.if ${.OBJDIR} != ${.CURDIR}
411RO_OBJDIR:=	${.OBJDIR}/roobj
412.else
413RO_OBJDIR:=	${TMPDIR:U/tmp}/roobj
414.endif
415# Additional environment variables for some of the tests.
416# The base environment is -i PATH="$PATH".
417ENV.depsrc-optional+=   TZ=UTC
418ENV.envfirst=		FROM_ENV=value-from-env
419ENV.objdir-writable+=	RO_OBJDIR=${RO_OBJDIR}
420ENV.varmisc=		FROM_ENV=env
421ENV.varmisc+=		FROM_ENV_BEFORE=env
422ENV.varmisc+=		FROM_ENV_AFTER=env
423ENV.varmod-localtime+=	TZ=Europe/Berlin
424ENV.varname-vpath+=	VPATH=varname-vpath.dir:varname-vpath.dir2
425
426# Override make flags for some of the tests; default is -k.
427# If possible, write ".MAKEFLAGS: -dv" in the test .mk file instead of
428# settings FLAGS.test=-dv here, since that is closer to the test code.
429FLAGS.cond-func-make=	via-cmdline
430FLAGS.directive-ifmake=	first second
431FLAGS.doterror=		# none, especially not -k
432FLAGS.varname-empty=	-dv '$${:U}=cmdline-u' '=cmdline-plain'
433
434# Some tests need extra postprocessing.
435SED_CMDS.export= \
436	-e '/^[^=_A-Za-z0-9]*=/d'
437# these all share the same requirement
438.for t in export-all export-env
439SED_CMDS.$t= ${SED_CMDS.export}
440.endfor
441SED_CMDS.directive-export-gmake= \
442	${:D dash is a pain } \
443	-e /non-zero/d
444SED_CMDS.job-output-long-lines= \
445	${:D Job separators on their own line are ok. } \
446	-e '/^--- job-[ab] ---$$/d' \
447	${:D Plain output lines are ok as well. } \
448	${:D They may come in multiples of 1024 or as 10000. } \
449	-e '/^aa*$$/d' \
450	-e '/^bb*$$/d' \
451	${:D The following lines should rather not occur since the job } \
452	${:D marker should always be at the beginning of the line. } \
453	-e '/^aa*--- job-b ---$$/d' \
454	-e '/^bb*--- job-a ---$$/d'
455SED_CMDS.objdir-writable= -e 's,${RO_OBJDIR},OBJDIR/roobj,g'
456SED_CMDS.opt-debug-graph1= \
457			-e 's,${.CURDIR},CURDIR,'
458SED_CMDS.opt-debug-graph1+= \
459			-e '/Global Variables:/,/Suffixes:/d'
460SED_CMDS.sh-dots=	-e 's,^.*\.\.\.:.*,<normalized: ...: not found>,'
461SED_CMDS.opt-debug-jobs=	-e 's,([0-9][0-9]*),(<pid>),'
462SED_CMDS.opt-debug-jobs+=	-e 's,pid [0-9][0-9]*,pid <pid>,'
463SED_CMDS.opt-debug-jobs+=	-e 's,Process [0-9][0-9]*,Process <pid>,'
464SED_CMDS.opt-debug-jobs+=	-e 's,JobFinish: [0-9][0-9]*,JobFinish: <pid>,'
465# The "-q" may be there or not, see jobs.c, variable shells.
466SED_CMDS.opt-debug-jobs+=	-e 's,^\(.Command: sh\) -q,\1,'
467SED_CMDS.var-op-shell+=	-e 's,^${.SHELL:T}: ,,'
468SED_CMDS.var-op-shell+=	-e '/command/{ s,^[1-9]: ,,;s,No such.*,not found,; }'
469SED_CMDS.vardebug= \
470	${:D canonicalize .SHELL } \
471	-e 's,${.SHELL},</path/to/shell>,'
472SED_CMDS.varmod-subst-regex+= \
473			-e 's,\(Regex compilation error:\).*,\1 (details omitted),'
474SED_CMDS.varmod-edge+=	-e 's, line [0-9]*:, line omitted:,'
475SED_CMDS.varname-dot-parsedir=	-e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,'
476SED_CMDS.varname-dot-parsefile=	-e '/in some cases/ s,^make: "[^"]*,make: "<normalized>,'
477SED_CMDS.varname-dot-shell=	-e 's, = /[^ ]*, = (details omitted),g'
478SED_CMDS.varname-dot-shell+=	-e 's,"/[^" ]*","(details omitted)",g'
479SED_CMDS.varname-dot-shell+=	-e 's,\[/[^] ]*\],[(details omitted)],g'
480
481# Some tests need an additional round of postprocessing.
482POSTPROC.deptgt-suffixes= \
483			${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p'
484POSTPROC.gnode-submake=	awk '/Input graph/, /^$$/'
485POSTPROC.varname-empty=	${TOOL_SED} -n -e '/^Var_Set/p' -e '/^out:/p'
486
487# Some tests reuse other tests, which makes them unnecessarily fragile.
488export-all.rawout: export.mk
489unexport.rawout: export.mk
490unexport-env.rawout: export.mk
491
492# End of the configuration section.
493
494.MAIN: all
495
496.sinclude "Makefile.inc"
497.sinclude "Makefile.config"
498
499UNIT_TESTS:= ${srcdir}
500.PATH: ${UNIT_TESTS}
501
502.if ${USE_ABSOLUTE_TESTNAMES:Uno} == yes
503OUTFILES=	${TESTS:@test@${.CURDIR:tA}/${test}.out@}
504.else
505OUTFILES=	${TESTS:=.out}
506.endif
507
508all: ${OUTFILES}
509
510CLEANFILES=		*.rawout *.out *.status *.tmp *.core *.tmp
511CLEANFILES+=		obj*.[och] lib*.a	# posix1.mk
512CLEANFILES+=		issue* .[ab]*		# suffixes.mk
513CLEANDIRS=		dir dummy		# posix1.mk
514
515clean:
516	rm -f ${CLEANFILES}
517	rm -rf ${CLEANDIRS}
518
519TEST_MAKE?=	${.MAKE}
520TOOL_SED?=	sed
521TOOL_TR?=	tr
522TOOL_DIFF?=	diff
523DIFF_FLAGS?=	-u
524
525.if defined(.PARSEDIR)
526# ensure consistent results from sort(1)
527LC_ALL=		C
528LANG=		C
529.export LANG LC_ALL
530.endif
531
532.if ${.MAKE.MODE:Unormal:Mmeta} != ""
533# we don't need the noise
534_MKMSG_TEST= :
535.endif
536
537MAKE_TEST_ENV?=	MALLOC_OPTIONS="JA"	# for jemalloc
538
539# Each test is run in a sub-make, to keep the tests for interfering with
540# each other, and because they use different environment variables and
541# command line options.
542.SUFFIXES: .mk .rawout .out
543.mk.rawout:
544	@${_MKMSG_TEST:Uecho '#      test '} ${.PREFIX}
545	@set -eu; \
546	cd ${.OBJDIR}; \
547	env -i PATH="$$PATH" ${MAKE_TEST_ENV} ${ENV.${.PREFIX:T}} \
548	  ${TEST_MAKE} \
549	    -r -C ${.CURDIR} -f ${.IMPSRC} \
550	    ${FLAGS.${.PREFIX:T}:U-k} \
551	    > ${.TARGET}.tmp 2>&1 \
552	&& status=$$? || status=$$?; \
553	echo $$status > ${.TARGET:R}.status
554	@mv ${.TARGET}.tmp ${.TARGET}
555
556# Postprocess the test output so that the results can be compared.
557#
558# always pretend .MAKE was called 'make'
559_SED_CMDS+=	-e 's,^${TEST_MAKE:T:S,.,\\.,g}[][0-9]*:,make:,'
560_SED_CMDS+=	-e 's,${TEST_MAKE:S,.,\\.,g},make,'
561_SED_CMDS+=	-e 's,${TEST_MAKE:T:S,.,\\.,g}[][0-9]* warning,make warning,'
562_SED_CMDS+=	-e 's,^usage: ${TEST_MAKE:T:S,.,\\.,g} ,usage: make ,'
563# replace anything after 'stopped in' with unit-tests
564_SED_CMDS+=	-e '/stopped/s, /.*, unit-tests,'
565# strip ${.CURDIR}/ from the output
566_SED_CMDS+=	-e 's,${.CURDIR:S,.,\\.,g}/,,g'
567_SED_CMDS+=	-e 's,${UNIT_TESTS:S,.,\\.,g}/,,g'
568
569.rawout.out:
570	@${TOOL_SED} ${_SED_CMDS} ${SED_CMDS.${.PREFIX:T}} \
571	  < ${.IMPSRC} > ${.TARGET}.tmp1
572	@${POSTPROC.${.PREFIX:T}:Ucat} < ${.TARGET}.tmp1 > ${.TARGET}.tmp2
573	@rm ${.TARGET}.tmp1
574	@echo "exit status `cat ${.TARGET:R}.status`" >> ${.TARGET}.tmp2
575	@mv ${.TARGET}.tmp2 ${.TARGET}
576
577# Compare all output files
578test:	${OUTFILES} .PHONY
579	@failed= ; \
580	for test in ${TESTS}; do \
581	  ${TOOL_DIFF} ${DIFF_FLAGS} ${UNIT_TESTS}/$${test}.exp $${test}.out \
582	  || failed="$${failed}$${failed:+ }$${test}" ; \
583	done ; \
584	if [ -n "$${failed}" ]; then \
585	  echo "Failed tests: $${failed}" ; false ; \
586	else \
587	  echo "All tests passed" ; \
588	fi
589
590accept:
591	@for test in ${TESTS}; do \
592	  cmp -s ${UNIT_TESTS}/$${test}.exp $${test}.out \
593	  || { echo "Replacing $${test}.exp" ; \
594	       cp $${test}.out ${UNIT_TESTS}/$${test}.exp ; } \
595	done
596
597.if exists(${TEST_MAKE})
598${TESTS:=.rawout}: ${TEST_MAKE}
599# in meta mode, we *know* if a target script is impacted
600# by a makefile change.
601.if ${.MAKE.MODE:Unormal:Mmeta} == ""
602${TESTS:=.rawout}: ${.PARSEDIR}/Makefile
603.endif
604.endif
605
606.sinclude <bsd.obj.mk>
607