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