1 # This is a generated file, do NOT edit!
2 # See contrib/bmake/bsd.after-import.mk
6 SRCTOP?= ${.CURDIR:H:H:H}
8 # $Id: Makefile.in,v 1.39 2012/11/09 19:16:10 sjg Exp $
10 # $NetBSD: Makefile,v 1.35 2012/11/09 19:08:28 sjg Exp $
12 # Unit tests for make(1)
13 # The main targets are:
15 # all: run all the tests
16 # test: run 'all', capture output and compare to expected results
17 # accept: move generated output to expected results
20 # Each feature should get its own set of tests in its own suitably
21 # named makefile which should be added to SUBFILES to hook it in.
24 srcdir= ${SRCTOP}/contrib/bmake/unit-tests
28 UNIT_TESTS:= ${srcdir}
30 # Simple sub-makefiles - we run them as a black box
31 # keep the list sorted.
65 # the tests are actually done with sub-makes.
67 .PRECIOUS: ${SUBFILES}
69 -@${.MAKE} ${flags.$@:U-k} -f ${UNIT_TESTS}/$@
72 rm -f *.out *.fail *.core
74 .sinclude <bsd.obj.mk>
82 # ensure consistent results from sort(1)
88 # We always pretend .MAKE was called 'make'
89 # and strip ${.CURDIR}/ from the output
90 # and replace anything after 'stopped in' with unit-tests
91 # so the results can be compared.
93 @echo "${TEST_MAKE} -f ${MAKEFILE} > ${.TARGET}.out 2>&1"
94 @cd ${.OBJDIR} && ${TEST_MAKE} -f ${MAKEFILE} 2>&1 | \
95 ${TOOL_TR} -d '\015' | \
96 ${TOOL_SED} -e 's,^${TEST_MAKE:T:C/\./\\\./g}:,make:,' \
97 -e '/stopped/s, /.*, unit-tests,' \
98 -e 's,${.CURDIR:C/\./\\\./g}/,,g' \
99 -e 's,${UNIT_TESTS:C/\./\\\./g}/,,g' > ${.TARGET}.out || { \
100 tail ${.TARGET}.out; mv ${.TARGET}.out ${.TARGET}.fail; exit 1; }
101 ${TOOL_DIFF} ${DIFF_FLAGS} ${UNIT_TESTS}/${.TARGET}.exp ${.TARGET}.out
104 mv test.out ${srcdir}/test.exp