fuse(4): build the tests with the new googletest in base

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Alan Somers 2019-03-19 03:10:13 +00:00
parent 2aaf9152a8
commit b2e95f1ce5

View File

@ -7,35 +7,35 @@ TESTSDIR= ${TESTSBASE}/sys/fs/fuse
# We could simply link all of these files into a single executable. But since # We could simply link all of these files into a single executable. But since
# Kyua treats googletest programs as plain tests, it's better to separate them # Kyua treats googletest programs as plain tests, it's better to separate them
# out, so we get more granular reporting. # out, so we get more granular reporting.
ATF_TESTS_CXX+= access GTESTS+= access
ATF_TESTS_CXX+= create GTESTS+= create
ATF_TESTS_CXX+= default_permissions GTESTS+= default_permissions
ATF_TESTS_CXX+= destroy GTESTS+= destroy
ATF_TESTS_CXX+= flush GTESTS+= flush
ATF_TESTS_CXX+= fsync GTESTS+= fsync
ATF_TESTS_CXX+= fsyncdir GTESTS+= fsyncdir
ATF_TESTS_CXX+= getattr GTESTS+= getattr
ATF_TESTS_CXX+= interrupt GTESTS+= interrupt
ATF_TESTS_CXX+= link GTESTS+= link
ATF_TESTS_CXX+= locks GTESTS+= locks
ATF_TESTS_CXX+= lookup GTESTS+= lookup
ATF_TESTS_CXX+= mkdir GTESTS+= mkdir
ATF_TESTS_CXX+= mknod GTESTS+= mknod
ATF_TESTS_CXX+= open GTESTS+= open
ATF_TESTS_CXX+= opendir GTESTS+= opendir
ATF_TESTS_CXX+= read GTESTS+= read
ATF_TESTS_CXX+= readdir GTESTS+= readdir
ATF_TESTS_CXX+= readlink GTESTS+= readlink
ATF_TESTS_CXX+= release GTESTS+= release
ATF_TESTS_CXX+= releasedir GTESTS+= releasedir
ATF_TESTS_CXX+= rename GTESTS+= rename
ATF_TESTS_CXX+= rmdir GTESTS+= rmdir
ATF_TESTS_CXX+= setattr GTESTS+= setattr
ATF_TESTS_CXX+= statfs GTESTS+= statfs
ATF_TESTS_CXX+= symlink GTESTS+= symlink
ATF_TESTS_CXX+= unlink GTESTS+= unlink
ATF_TESTS_CXX+= write GTESTS+= write
ATF_TESTS_CXX+= xattr GTESTS+= xattr
SRCS.access+= access.cc SRCS.access+= access.cc
SRCS.access+= getmntopts.c SRCS.access+= getmntopts.c
@ -51,6 +51,7 @@ SRCS.default_permissions+= default_permissions.cc
SRCS.default_permissions+= getmntopts.c SRCS.default_permissions+= getmntopts.c
SRCS.default_permissions+= mockfs.cc SRCS.default_permissions+= mockfs.cc
SRCS.default_permissions+= utils.cc SRCS.default_permissions+= utils.cc
TEST_METADATA.default_permissions+= required_user="unprivileged"
SRCS.destroy+= destroy.cc SRCS.destroy+= destroy.cc
SRCS.destroy+= getmntopts.c SRCS.destroy+= getmntopts.c
@ -106,6 +107,7 @@ SRCS.mknod+= getmntopts.c
SRCS.mknod+= mockfs.cc SRCS.mknod+= mockfs.cc
SRCS.mknod+= mknod.cc SRCS.mknod+= mknod.cc
SRCS.mknod+= utils.cc SRCS.mknod+= utils.cc
TEST_METADATA.mknod+= required_user="root"
SRCS.open+= getmntopts.c SRCS.open+= getmntopts.c
SRCS.open+= mockfs.cc SRCS.open+= mockfs.cc
@ -191,22 +193,16 @@ CFLAGS+= -I${.CURDIR:H:H:H}
CFLAGS+= -I${FUSEFS} CFLAGS+= -I${FUSEFS}
CFLAGS+= -I${MOUNT} CFLAGS+= -I${MOUNT}
.PATH: ${MOUNT} .PATH: ${MOUNT}
CXXSTD= c++14
LIBADD+= util pthread # XXX Setting CXXFLAGS globally seems to be necessary to get mockfs.cc and
WARNS?= 6 # utils.cc to build correctly.
NO_WTHREAD_SAFETY= # GoogleTest fails Clang's thread safety check CXXFLAGS+= ${GTESTS_CXXFLAGS}
# Use googlemock from ports until after the import-googletest-1.8.1 branch
# merges to head.
CXXFLAGS+= -I/usr/local/include
CXXFLAGS+= -DGTEST_HAS_POSIX_RE=1
CXXFLAGS+= -DGTEST_HAS_PTHREAD=1
CXXFLAGS+= -DGTEST_HAS_STREAM_REDIRECTION=1
CXXFLAGS+= -frtti
CXXFLAGS+= -std=c++14
LDADD+= ${LOCALBASE}/lib/libgmock.a
LDADD+= ${LOCALBASE}/lib/libgtest.a
# Without -lpthread, gtest fails at _runtime_ with the error pthread_key_create(&key, &DeleteThreadLocalValue)failed with error 78
LIBADD+= pthread LIBADD+= pthread
LIBADD+= gmock gtest
LIBADD+= util
WARNS?= 6
.include <bsd.test.mk> .include <bsd.test.mk>