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