xref: /freebsd/tests/sys/kern/Makefile (revision d7d962ead0b6e5e8a39202d0590022082bf5bfb6)
1# $FreeBSD$
2
3PACKAGE=	tests
4
5TESTSRC=	${SRCTOP}/contrib/netbsd-tests/kernel
6.PATH:		${SRCTOP}/sys/kern
7
8TESTSDIR=	${TESTSBASE}/sys/kern
9
10#ATF_TESTS_C+=	kcov
11ATF_TESTS_C+=	kern_copyin
12ATF_TESTS_C+=	kern_descrip_test
13ATF_TESTS_C+=	fdgrowtable_test
14ATF_TESTS_C+=	kill_zombie
15ATF_TESTS_C+=	ptrace_test
16TEST_METADATA.ptrace_test+=		timeout="15"
17ATF_TESTS_C+=	reaper
18ATF_TESTS_C+=	sigaltstack
19PLAIN_TESTS_C+=	subr_unit_test
20ATF_TESTS_C+=	sys_getrandom
21ATF_TESTS_C+=	unix_passfd_test
22ATF_TESTS_C+=	unix_seqpacket_test
23TEST_METADATA.unix_seqpacket_test+=	timeout="15"
24ATF_TESTS_C+=	unix_socketpair_test
25ATF_TESTS_C+=	waitpid_nohang
26ATF_TESTS_C+=	pdeathsig
27
28ATF_TESTS_SH+=	coredump_phnum_test
29ATF_TESTS_SH+=	sonewconn_overflow
30TEST_METADATA.sonewconn_overflow+=	required_programs="python"
31TEST_METADATA.sonewconn_overflow+=	required_user="root"
32ATF_TESTS_SH+=	sendfile_test
33
34${PACKAGE}FILES+=	sonewconn_overflow.py
35${PACKAGE}FILESMODE_sonewconn_overflow.py=0555
36
37BINDIR=		${TESTSDIR}
38PROGS+=		coredump_phnum_helper
39PROGS+=		pdeathsig_helper
40PROGS+=		sendfile_helper
41
42CFLAGS.sys_getrandom+=			-I${SRCTOP}/sys/contrib/zstd/lib
43LIBADD.sys_getrandom+=			zstd
44LIBADD.sys_getrandom+=			c
45LIBADD.sys_getrandom+=			pthread
46LIBADD.ptrace_test+=			pthread
47LIBADD.unix_seqpacket_test+=		pthread
48LIBADD.kcov+=				pthread
49LIBADD.sendfile_helper+=		pthread
50LIBADD.fdgrowtable_test+=		util pthread kvm procstat
51
52NETBSD_ATF_TESTS_C+=	lockf_test
53NETBSD_ATF_TESTS_C+=	mqueue_test
54NETBSD_ATF_TESTS_C+=	sysv_test
55
56CFLAGS.mqueue_test+=	-I${SRCTOP}/tests
57LIBADD.mqueue_test+=	rt
58
59ATF_TESTS_C+=	libkern_crc32
60SRCS.libkern_crc32+=	libkern_crc32.c
61.PATH: ${SRCTOP}/sys/libkern
62SRCS.libkern_crc32+=	gsb_crc32.c
63CFLAGS.libkern_crc32+=	-DTESTING
64.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
65.PATH: ${SRCTOP}/sys/libkern/x86
66SRCS.libkern_crc32+=	crc32_sse42.c
67.elif ${MACHINE_CPUARCH} == "aarch64"
68.PATH: ${SRCTOP}/sys/libkern/arm64
69SRCS.libkern_crc32+=	crc32c_armv8.S
70.endif
71
72# subr_unit.c contains functions whose prototypes lie in headers that cannot be
73# included in userland.  But as far as subr_unit_test goes, they're effectively
74# static.  So it's ok to disable -Wmissing-prototypes for this program.
75CFLAGS.subr_unit.c+=	-Wno-missing-prototypes
76SRCS.subr_unit_test+=	subr_unit.c
77
78WARNS?=	3
79
80TESTS_SUBDIRS+=	acct
81TESTS_SUBDIRS+=	execve
82TESTS_SUBDIRS+=	pipe
83
84.include <netbsd-tests.test.mk>
85
86.include <bsd.test.mk>
87