xref: /freebsd/tests/sys/kern/Makefile (revision f73124b077d867990cbcb4d903b48be2ca55e4ca)
1
2.include <src.opts.mk>
3
4PACKAGE=	tests
5
6TESTSRC=	${SRCTOP}/contrib/netbsd-tests/kernel
7.PATH:		${SRCTOP}/sys/kern
8
9TESTSDIR=	${TESTSBASE}/sys/kern
10
11ATF_TESTS_C+=	basic_signal
12.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH} != "powerpc" && \
13	${MACHINE_ARCH} != "powerpcspe"
14# No support for atomic_load_64 on i386 or (32-bit) powerpc
15ATF_TESTS_C+=	kcov
16.endif
17ATF_TESTS_C+=	kern_copyin
18ATF_TESTS_C+=	kern_descrip_test
19ATF_TESTS_C+=	fdgrowtable_test
20ATF_TESTS_C+=	kill_zombie
21.if ${MK_OPENSSL} != "no"
22ATF_TESTS_C+=	ktls_test
23.endif
24ATF_TESTS_C+=	module_test
25ATF_TESTS_C+=	ptrace_test
26TEST_METADATA.ptrace_test+=		timeout="15"
27ATF_TESTS_C+=	reaper
28ATF_TESTS_C+=	sched_affinity
29ATF_TESTS_C+=	shutdown_dgram
30ATF_TESTS_C+=	sigaltstack
31ATF_TESTS_C+=	sigwait
32ATF_TESTS_C+=	socket_accept
33ATF_TESTS_C+=	socket_accf
34ATF_TESTS_C+=	socket_msg_trunc
35ATF_TESTS_C+=	socket_msg_waitall
36TEST_METADATA.sigwait+=	is_exclusive="true"
37.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH:Mpowerpc*} == ""
38ATF_TESTS_C+=	subr_physmem_test
39.endif
40PLAIN_TESTS_C+=	subr_unit_test
41ATF_TESTS_C+=	sysctl_kern_proc
42ATF_TESTS_C+=	sys_getrandom
43ATF_TESTS_C+=	tty_pts
44ATF_TESTS_C+=	unix_dgram
45ATF_TESTS_C+=	unix_passfd_dgram
46TEST_METADATA.unix_passfd_dgram+=	is_exclusive="true"
47ATF_TESTS_C+=	unix_passfd_stream
48TEST_METADATA.unix_passfd_stream+=	is_exclusive="true"
49ATF_TESTS_C+=	unix_seqpacket_test
50TEST_METADATA.unix_seqpacket_test+=	timeout="15"
51ATF_TESTS_C+=	unix_socketpair_test
52ATF_TESTS_C+=	waitpid_nohang
53ATF_TESTS_C+=	pdeathsig
54ATF_TESTS_C+=	sigsys
55TEST_METADATA.sigsys+=	is_exclusive="true"
56
57ATF_TESTS_SH+=	coredump_phnum_test
58ATF_TESTS_SH+=	sonewconn_overflow
59TEST_METADATA.sonewconn_overflow+=	required_programs="python"
60TEST_METADATA.sonewconn_overflow+=	required_user="root"
61ATF_TESTS_SH+=	sendfile_test
62ATF_TESTS_SH+=	sysctl_security_jail_children
63TEST_METADATA.sysctl_security_jail_children+=	is_exclusive="true"
64
65${PACKAGE}FILES+=	sonewconn_overflow.py
66${PACKAGE}FILESMODE_sonewconn_overflow.py=0555
67
68BINDIR=		${TESTSDIR}
69PROGS+=		coredump_phnum_helper
70PROGS+=		pdeathsig_helper
71PROGS+=		sendfile_helper
72
73CFLAGS.sys_getrandom+=			-I${SRCTOP}/sys/contrib/zstd/lib
74LIBADD.sys_getrandom+=			zstd
75LIBADD.sys_getrandom+=			c
76LIBADD.sys_getrandom+=			pthread
77LIBADD.ptrace_test+=			pthread
78LIBADD.unix_seqpacket_test+=		pthread
79LIBADD.kcov+=				pthread
80CFLAGS.ktls_test+=			-DOPENSSL_API_COMPAT=0x10100000L
81LIBADD.ktls_test+=			crypto util
82LIBADD.shutdown_dgram+=			pthread
83LIBADD.socket_msg_waitall+=		pthread
84LIBADD.sendfile_helper+=		pthread
85LIBADD.fdgrowtable_test+=		util pthread kvm procstat
86LIBADD.sigwait+=			rt
87
88NETBSD_ATF_TESTS_C+=	lockf_test
89NETBSD_ATF_TESTS_C+=	mqueue_test
90NETBSD_ATF_TESTS_C+=	sysv_test
91
92CFLAGS.mqueue_test+=	-I${SRCTOP}/tests
93LIBADD.mqueue_test+=	rt
94
95LIBADD.tty_pts+=	atf_c util
96
97ATF_TESTS_C+=	libkern_crc32
98SRCS.libkern_crc32+=	libkern_crc32.c
99.PATH: ${SRCTOP}/sys/libkern
100SRCS.libkern_crc32+=	gsb_crc32.c
101CFLAGS.libkern_crc32+=	-DTESTING
102.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
103.PATH: ${SRCTOP}/sys/libkern/x86
104SRCS.libkern_crc32+=	crc32_sse42.c
105.elif ${MACHINE_CPUARCH} == "aarch64"
106.PATH: ${SRCTOP}/sys/libkern/arm64
107SRCS.libkern_crc32+=	crc32c_armv8.S
108.endif
109
110CFLAGS.subr_physmem.c+=	-D_WANT_FREEBSD_BITSET
111SRCS.subr_physmem_test+= subr_physmem_test.c subr_physmem.c
112
113# subr_unit.c contains functions whose prototypes lie in headers that cannot be
114# included in userland.  But as far as subr_unit_test goes, they're effectively
115# static.  So it's ok to disable -Wmissing-prototypes for this program.
116CFLAGS.subr_unit.c+=	-Wno-missing-prototypes
117SRCS.subr_unit_test+=	subr_unit.c
118
119WARNS?=	3
120
121TESTS_SUBDIRS+=	acct
122TESTS_SUBDIRS+=	execve
123TESTS_SUBDIRS+=	pipe
124
125.include <netbsd-tests.test.mk>
126
127.include <bsd.test.mk>
128