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