xref: /openbsd/regress/Makefile (revision 6f40fd34)
1#	$OpenBSD: Makefile,v 1.22 2017/07/07 23:55:21 bluhm Exp $
2
3#
4# To run full regression tests you just need one step:
5# make regress
6#
7# A normal "make" is not necessary and will simply do the same thing
8# as "regress" (possibly with more bugs). This allows us to include
9# compilation as a part of the regression test.
10#
11# To get a log of test results set the REGRESS_LOG make variable to
12# a log file, use an absolute path.
13# To mail the test results set the REGRESS_MAIL make variable to an
14# email address.
15# To skip the really slow tests, set the REGRESS_SKIP_SLOW variable.
16
17SUBDIR+= etc bin include lib libexec sbin sys usr.bin usr.sbin misc gnu
18
19install:
20
21REGRESS_MAIL?=
22
23.if !empty(REGRESS_MAIL)
24_REGRESS_TMP!=/usr/bin/mktemp
25.endif
26
27.if empty(REGRESS_MAIL) || empty(_REGRESS_TMP)
28_REGRESS_TMP=
29_REGRESS_CLEAN=exit 0
30.else
31_REGRESS_CLEAN=rm -f ${_REGRESS_TMP}
32.endif
33MAKE_FLAGS+= _REGRESS_TMP=${_REGRESS_TMP}
34
35.INTERRUPT:
36	${_REGRESS_CLEAN}
37
38.END: .SILENT
39.if ${.TARGETS:Mall} || ${.TARGETS:Mregress}
40	echo ====================================================================
41.if empty(REGRESS_MAIL) || empty(_REGRESS_TMP)
42	echo You can set REGRESS_LOG to point to a file and mail it manually.
43	echo $$ make REGRESS_LOG=/var/log/regress-tests regress
44.else
45	echo Mailing regress results to ${REGRESS_MAIL} ...
46	echo If you want them to be also logged locally, you can set the
47	echo REGRESS_LOG make variable to the full path of a log file.
48	(sysctl -n kern.version && cat ${_REGRESS_TMP}) | /usr/bin/mail -s "Regress: `uname -a`" ${REGRESS_MAIL}
49.endif
50	echo ====================================================================
51	${_REGRESS_CLEAN}
52.endif
53
54.include <bsd.subdir.mk>
55