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