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