xref: /freebsd/tests/sys/kern/Makefile (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
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+=	sigaltstack
30ATF_TESTS_C+=	sigwait
31ATF_TESTS_C+=	socket_accf
32ATF_TESTS_C+=	socket_msg_trunc
33TEST_METADATA.sigwait+=	is_exclusive="true"
34.if ${MACHINE_ARCH} != "i386" && ${MACHINE_ARCH:Mpowerpc*} == ""
35ATF_TESTS_C+=	subr_physmem_test
36.endif
37PLAIN_TESTS_C+=	subr_unit_test
38ATF_TESTS_C+=	sysctl_kern_proc
39ATF_TESTS_C+=	sys_getrandom
40ATF_TESTS_C+=	unix_dgram
41ATF_TESTS_C+=	unix_passfd_dgram
42TEST_METADATA.unix_passfd_dgram+=	is_exclusive="true"
43ATF_TESTS_C+=	unix_passfd_stream
44TEST_METADATA.unix_passfd_stream+=	is_exclusive="true"
45ATF_TESTS_C+=	unix_seqpacket_test
46TEST_METADATA.unix_seqpacket_test+=	timeout="15"
47ATF_TESTS_C+=	unix_socketpair_test
48ATF_TESTS_C+=	waitpid_nohang
49ATF_TESTS_C+=	pdeathsig
50
51ATF_TESTS_SH+=	coredump_phnum_test
52ATF_TESTS_SH+=	sonewconn_overflow
53TEST_METADATA.sonewconn_overflow+=	required_programs="python"
54TEST_METADATA.sonewconn_overflow+=	required_user="root"
55ATF_TESTS_SH+=	sendfile_test
56
57${PACKAGE}FILES+=	sonewconn_overflow.py
58${PACKAGE}FILESMODE_sonewconn_overflow.py=0555
59
60BINDIR=		${TESTSDIR}
61PROGS+=		coredump_phnum_helper
62PROGS+=		pdeathsig_helper
63PROGS+=		sendfile_helper
64
65CFLAGS.sys_getrandom+=			-I${SRCTOP}/sys/contrib/zstd/lib
66LIBADD.sys_getrandom+=			zstd
67LIBADD.sys_getrandom+=			c
68LIBADD.sys_getrandom+=			pthread
69LIBADD.ptrace_test+=			pthread
70LIBADD.unix_seqpacket_test+=		pthread
71LIBADD.kcov+=				pthread
72CFLAGS.ktls_test+=			-DOPENSSL_API_COMPAT=0x10100000L
73LIBADD.ktls_test+=			crypto util
74LIBADD.sendfile_helper+=		pthread
75LIBADD.fdgrowtable_test+=		util pthread kvm procstat
76LIBADD.sigwait+=			rt
77
78NETBSD_ATF_TESTS_C+=	lockf_test
79NETBSD_ATF_TESTS_C+=	mqueue_test
80NETBSD_ATF_TESTS_C+=	sysv_test
81
82CFLAGS.mqueue_test+=	-I${SRCTOP}/tests
83LIBADD.mqueue_test+=	rt
84
85ATF_TESTS_C+=	libkern_crc32
86SRCS.libkern_crc32+=	libkern_crc32.c
87.PATH: ${SRCTOP}/sys/libkern
88SRCS.libkern_crc32+=	gsb_crc32.c
89CFLAGS.libkern_crc32+=	-DTESTING
90.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
91.PATH: ${SRCTOP}/sys/libkern/x86
92SRCS.libkern_crc32+=	crc32_sse42.c
93.elif ${MACHINE_CPUARCH} == "aarch64"
94.PATH: ${SRCTOP}/sys/libkern/arm64
95SRCS.libkern_crc32+=	crc32c_armv8.S
96.endif
97
98CFLAGS.subr_physmem.c+=	-D_WANT_FREEBSD_BITSET
99SRCS.subr_physmem_test+= subr_physmem_test.c subr_physmem.c
100
101# subr_unit.c contains functions whose prototypes lie in headers that cannot be
102# included in userland.  But as far as subr_unit_test goes, they're effectively
103# static.  So it's ok to disable -Wmissing-prototypes for this program.
104CFLAGS.subr_unit.c+=	-Wno-missing-prototypes
105SRCS.subr_unit_test+=	subr_unit.c
106
107WARNS?=	3
108
109TESTS_SUBDIRS+=	acct
110TESTS_SUBDIRS+=	execve
111TESTS_SUBDIRS+=	pipe
112
113.include <netbsd-tests.test.mk>
114
115.include <bsd.test.mk>
116