mirror of
https://github.com/opnsense/src.git
synced 2026-04-20 21:59:20 -04:00
- TESTSBASE and LOCALBASE are already defined in bsd.tests.mk
- TESTSDIR is automatically divined as ${TESTSBASE}${RELDIR:H} after
r289158.
- Replace SRCDIR with SRCTOP
MFC after: 1 week
X-MFC with: r305019
Sponsored by: EMC / Isilon Storage Division
38 lines
1.1 KiB
Makefile
38 lines
1.1 KiB
Makefile
# $FreeBSD$
|
|
|
|
.include "${.CURDIR}/../Makefile.common"
|
|
.PATH: ${.CURDIR:H}
|
|
|
|
PLAIN_TESTS_CXX= zfsd_unittest
|
|
SRCS.zfsd_unittest:= ${SRCS:Nzfsd_main.cc}
|
|
SRCS.zfsd_unittest+= libmocks.c zfsd_unittest.cc
|
|
SRCS=
|
|
|
|
# Use #include <zfsd/xxx.h> in test programs.
|
|
INCFLAGS+= -I${.CURDIR:H:H}
|
|
|
|
.if defined(DESTDIR)
|
|
INCFLAGS+= -I${DESTDIR}/usr/include
|
|
LIBRARY_PATH= ${DESTDIR}/lib:${DESTDIR}/usr/lib
|
|
LDFLAGS.zfsd_unittest+= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib
|
|
.elif defined(WORLDTMP)
|
|
INCFLAGS+= -I${WORLDTMP}/usr/include
|
|
LIBRARY_PATH= ${WORLDTMP}/lib:${WORLDTMP}/usr/lib
|
|
LDFLAGS.zfsd_unittest+= -L${WORLDTMP}/lib -L${WORLDTMP}/usr/lib
|
|
.else
|
|
LIBRARY_PATH=
|
|
.endif
|
|
|
|
# Googletest options
|
|
INCFLAGS+= -I${LOCALBASE}/include -D_THREAD_SAFE -pthread
|
|
LDFLAGS.zfsd_unittest+= -L${LOCALBASE}/lib -D_THREAD_SAFE -pthread
|
|
LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgtest.a
|
|
|
|
# GoogleMock options
|
|
LDADD.zfsd_unittest+= ${LOCALBASE}/lib/libgmock.a ${LOCALBASE}/lib/libgmock_main.a
|
|
|
|
# Googlemock fails if we don't have this line
|
|
# https://groups.google.com/forum/#!msg/googletestframework/h8ixEPCFm0o/amwfu4xGJb0J
|
|
CFLAGS.zfsd_unittest+= -DGTEST_HAS_PTHREAD
|
|
|
|
.include <bsd.test.mk>
|