xref: /freebsd/crypto/openssh/regress/unittests/Makefile.inc (revision 397e83df75e0fcd0d3fcb95ae4d794cb7600fc89)
1#	$OpenBSD: Makefile.inc,v 1.16 2024/01/11 01:45:58 djm Exp $
2
3.include <bsd.own.mk>
4.include <bsd.obj.mk>
5
6# User-settable options
7UNITTEST_FAST?= no	# Skip slow tests (e.g. less intensive fuzzing).
8UNITTEST_SLOW?= no	# Include slower tests (e.g. more intensive fuzzing).
9UNITTEST_VERBOSE?= no	# Verbose test output (inc. per-test names).
10
11MALLOC_OPTIONS?=	CFGJRSUX
12TEST_ENV?=		MALLOC_OPTIONS=${MALLOC_OPTIONS}
13
14# XXX detect from ssh binary?
15OPENSSL?=	yes
16DSAKEY?=	yes
17
18.if (${DSAKEY:L} == "yes")
19CFLAGS+=	-DWITH_DSA
20.endif
21
22.if (${OPENSSL:L} == "yes")
23CFLAGS+=	-DWITH_OPENSSL
24.endif
25
26# enable warnings
27WARNINGS=Yes
28
29DEBUG=-g
30CFLAGS+=	-fstack-protector-all
31CDIAGFLAGS=	-Wall
32CDIAGFLAGS+=	-Wextra
33CDIAGFLAGS+=	-Werror
34CDIAGFLAGS+=	-Wchar-subscripts
35CDIAGFLAGS+=	-Wcomment
36CDIAGFLAGS+=	-Wformat
37CDIAGFLAGS+=	-Wformat-security
38CDIAGFLAGS+=	-Wimplicit
39CDIAGFLAGS+=	-Winline
40CDIAGFLAGS+=	-Wmissing-declarations
41CDIAGFLAGS+=	-Wmissing-prototypes
42CDIAGFLAGS+=	-Wparentheses
43CDIAGFLAGS+=	-Wpointer-arith
44CDIAGFLAGS+=	-Wreturn-type
45CDIAGFLAGS+=	-Wshadow
46CDIAGFLAGS+=	-Wsign-compare
47CDIAGFLAGS+=	-Wstrict-aliasing
48CDIAGFLAGS+=	-Wstrict-prototypes
49CDIAGFLAGS+=	-Wswitch
50CDIAGFLAGS+=	-Wtrigraphs
51CDIAGFLAGS+=	-Wuninitialized
52CDIAGFLAGS+=	-Wunused
53CDIAGFLAGS+=	-Wno-unused-parameter
54.if ${COMPILER_VERSION:L} != "gcc3"
55CDIAGFLAGS+=	-Wold-style-definition
56.endif
57
58SSHREL=../../../../../usr.bin/ssh
59
60CFLAGS+=-I${.CURDIR}/../test_helper -I${.CURDIR}/${SSHREL}
61
62.if exists(${.CURDIR}/../test_helper/${__objdir})
63LDADD+=-L${.CURDIR}/../test_helper/${__objdir} -ltest_helper
64DPADD+=${.CURDIR}/../test_helper/${__objdir}/libtest_helper.a
65.else
66LDADD+=-L${.CURDIR}/../test_helper -ltest_helper
67DPADD+=${.CURDIR}/../test_helper/libtest_helper.a
68.endif
69
70.PATH: ${.CURDIR}/${SSHREL}
71
72LDADD+= -lutil
73DPADD+= ${LIBUTIL}
74
75.if (${OPENSSL:L} == "yes")
76LDADD+= -lcrypto
77DPADD+= ${LIBCRYPTO}
78.endif
79
80LDADD+= -lfido2 -lcbor -lusbhid
81DPADD+= ${LIBFIDO2} ${LIBCBOR} ${LIBUSBHID}
82
83UNITTEST_ARGS?=
84
85.if (${UNITTEST_VERBOSE:L} != "no")
86UNITTEST_ARGS+= -v
87.endif
88.if (${UNITTEST_FAST:L} != "no")
89UNITTEST_ARGS+= -f
90.elif (${UNITTEST_SLOW:L} != "no")
91UNITTEST_ARGS+= -F
92.endif
93