3 # Generic build infrastructure for test programs.
5 # This is the only public file that should be included by Makefiles when
6 # tests are to be built. All other *.test.mk files are internal and not
7 # to be included directly.
13 # Third-party software (kyua, etc) prefix.
14 LOCALBASE?= /usr/local
16 # Tests install directory
17 TESTSDIR?= ${TESTSBASE}/${RELDIR:H}
19 # List of subdirectories containing tests into which to recurse. This has the
20 # same semantics as SUBDIR at build-time. However, the directories listed here
21 # get registered into the run-time test suite definitions so that the test
22 # engines know to recurse into these directories.
24 # In other words: list here any directories that contain test programs but use
25 # SUBDIR for directories that may contain helper binaries and/or data files.
28 # If defined, indicates that the tests built by the Makefile are not part of
29 # the FreeBSD Test Suite. The implication of this is that the tests won't be
30 # installed under /usr/tests/ and that Kyua won't be able to run them.
33 # List of variables to pass to the tests at run-time via the environment.
36 # Force all tests in a separate distribution file.
38 # We want this to be the case even when the distribution name is already
39 # overriden. For example: we want the tests for programs in the 'games'
40 # distribution to end up in the 'tests' distribution; the test programs
41 # themselves have all the necessary logic to detect that the games are not
42 # installed and thus won't cause false negatives.
45 # Ordered list of directories to construct the PATH for the tests.
46 TESTS_PATH+= ${DESTDIR}/bin ${DESTDIR}/sbin \
47 ${DESTDIR}/usr/bin ${DESTDIR}/usr/sbin
48 TESTS_ENV+= PATH=${TESTS_PATH:tW:C/ +/:/g}
50 # Ordered list of directories to construct the LD_LIBRARY_PATH for the tests.
51 TESTS_LD_LIBRARY_PATH+= ${DESTDIR}/lib ${DESTDIR}/usr/lib
52 TESTS_ENV+= LD_LIBRARY_PATH=${TESTS_LD_LIBRARY_PATH:tW:C/ +/:/g}
54 # List of all tests being built. The various *.test.mk modules extend this
58 # Pull in the definitions of all supported test interfaces.
59 .include <atf.test.mk>
60 .include <plain.test.mk>
61 .include <tap.test.mk>
63 # kyua automatically descends directories; only run make check on the
66 .for ts in ${TESTS_SUBDIRS}
67 .if empty(SUBDIR:M${ts})
74 # it is rare for test cases to have man pages
79 # tell progs.mk we might want to install things
81 PROGS_TARGETS+= install
83 .if !defined(NOT_FOR_TEST_SUITE)
84 .include <suite.test.mk>
87 .if !target(realcheck)
89 @echo "$@ not defined; skipping"
92 beforecheck realcheck aftercheck check: .PHONY
93 .ORDER: beforecheck realcheck aftercheck
94 check: beforecheck realcheck aftercheck
96 .include <bsd.progs.mk>