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