xref: /freebsd/tests/sys/kern/Makefile (revision e9e8876a4d6afc1ad5315faaa191b25121a813d7)
1# $FreeBSD$
2
3.include <src.opts.mk>
4
5PACKAGE=	tests
6
7TESTSRC=	${SRCTOP}/contrib/netbsd-tests/kernel
8.PATH:		${SRCTOP}/sys/kern
9
10TESTSDIR=	${TESTSBASE}/sys/kern
11
12ATF_TESTS_C+=	basic_signal
13#ATF_TESTS_C+=	kcov
14ATF_TESTS_C+=	kern_copyin
15ATF_TESTS_C+=	kern_descrip_test
16ATF_TESTS_C+=	fdgrowtable_test
17ATF_TESTS_C+=	kill_zombie
18.if ${MK_OPENSSL} != "no"
19ATF_TESTS_C+=	ktls_test
20.endif
21ATF_TESTS_C+=	ptrace_test
22TEST_METADATA.ptrace_test+=		timeout="15"
23ATF_TESTS_C+=	reaper
24ATF_TESTS_C+=	sigaltstack
25PLAIN_TESTS_C+=	subr_unit_test
26ATF_TESTS_C+=	sysctl_kern_proc
27ATF_TESTS_C+=	sys_getrandom
28ATF_TESTS_C+=	unix_passfd_test
29ATF_TESTS_C+=	unix_seqpacket_test
30TEST_METADATA.unix_seqpacket_test+=	timeout="15"
31ATF_TESTS_C+=	unix_socketpair_test
32ATF_TESTS_C+=	waitpid_nohang
33ATF_TESTS_C+=	pdeathsig
34
35ATF_TESTS_SH+=	coredump_phnum_test
36ATF_TESTS_SH+=	sonewconn_overflow
37TEST_METADATA.sonewconn_overflow+=	required_programs="python"
38TEST_METADATA.sonewconn_overflow+=	required_user="root"
39ATF_TESTS_SH+=	sendfile_test
40
41${PACKAGE}FILES+=	sonewconn_overflow.py
42${PACKAGE}FILESMODE_sonewconn_overflow.py=0555
43
44BINDIR=		${TESTSDIR}
45PROGS+=		coredump_phnum_helper
46PROGS+=		pdeathsig_helper
47PROGS+=		sendfile_helper
48
49CFLAGS.sys_getrandom+=			-I${SRCTOP}/sys/contrib/zstd/lib
50LIBADD.sys_getrandom+=			zstd
51LIBADD.sys_getrandom+=			c
52LIBADD.sys_getrandom+=			pthread
53LIBADD.ptrace_test+=			pthread
54LIBADD.unix_seqpacket_test+=		pthread
55LIBADD.kcov+=				pthread
56LIBADD.ktls_test+=			crypto
57LIBADD.sendfile_helper+=		pthread
58LIBADD.fdgrowtable_test+=		util pthread kvm procstat
59
60NETBSD_ATF_TESTS_C+=	lockf_test
61NETBSD_ATF_TESTS_C+=	mqueue_test
62NETBSD_ATF_TESTS_C+=	sysv_test
63
64CFLAGS.mqueue_test+=	-I${SRCTOP}/tests
65LIBADD.mqueue_test+=	rt
66
67ATF_TESTS_C+=	libkern_crc32
68SRCS.libkern_crc32+=	libkern_crc32.c
69.PATH: ${SRCTOP}/sys/libkern
70SRCS.libkern_crc32+=	gsb_crc32.c
71CFLAGS.libkern_crc32+=	-DTESTING
72.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
73.PATH: ${SRCTOP}/sys/libkern/x86
74SRCS.libkern_crc32+=	crc32_sse42.c
75.elif ${MACHINE_CPUARCH} == "aarch64"
76.PATH: ${SRCTOP}/sys/libkern/arm64
77SRCS.libkern_crc32+=	crc32c_armv8.S
78.endif
79
80# subr_unit.c contains functions whose prototypes lie in headers that cannot be
81# included in userland.  But as far as subr_unit_test goes, they're effectively
82# static.  So it's ok to disable -Wmissing-prototypes for this program.
83CFLAGS.subr_unit.c+=	-Wno-missing-prototypes
84SRCS.subr_unit_test+=	subr_unit.c
85
86WARNS?=	3
87
88TESTS_SUBDIRS+=	acct
89TESTS_SUBDIRS+=	execve
90TESTS_SUBDIRS+=	pipe
91
92.include <netbsd-tests.test.mk>
93
94.include <bsd.test.mk>
95