Compile and install most of the googletest examples

sample9_unittest is not compiled/installed, because it intentionally fails
and would result in red test runs until broken to always pass.
This commit is contained in:
Enji Cooper 2019-03-11 19:50:44 +00:00
parent ff511f1f39
commit 9bfc4020c4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/import-googletest-1.8.1/; revision=345023
3 changed files with 44 additions and 0 deletions

View File

@ -440,6 +440,8 @@
tests
atf
..
googletest
..
plain
..
tap

View File

@ -1,5 +1,7 @@
# $FreeBSD$
.include <src.opts.mk>
# Directory into which the Kyuafile provided by this directory will be
# installed.
#
@ -21,6 +23,10 @@ TESTS_SUBDIRS+= atf
TESTS_SUBDIRS+= plain
TESTS_SUBDIRS+= tap
.if ${MK_GOOGLETEST} != no
TESTS_SUBDIRS+= googletest
.endif
# We leave KYUAFILE unset so that bsd.test.mk auto-generates a Kyuafile
# for us based on the contents of the TESTS_SUBDIRS line above. The
# generated file will tell the tests run-time engine to recurse into the

View File

@ -0,0 +1,36 @@
# $FreeBSD$
.PATH: ${SRCTOP}/contrib/googletest/googletest/samples
GTEST_MAIN_REQ_TESTS+= sample1_unittest
GTEST_MAIN_REQ_TESTS+= sample2_unittest
GTEST_MAIN_REQ_TESTS+= sample3_unittest
GTEST_MAIN_REQ_TESTS+= sample4_unittest
GTEST_MAIN_REQ_TESTS+= sample5_unittest
GTEST_MAIN_REQ_TESTS+= sample6_unittest
GTEST_MAIN_REQ_TESTS+= sample7_unittest
GTEST_MAIN_REQ_TESTS+= sample8_unittest
# sample9_unittest's `CustomOutputTest.Fails` fails intentionally to illustrate
# how output format can be adjusted with command-line parameters.
#GTEST_REQ_TESTS+= sample9_unittest
GTEST_REQ_TESTS+= sample10_unittest
.for t in ${GTEST_MAIN_REQ_TESTS}
GTESTS+= $t
LIBADD.$t+= gtest_main
SRCS.$t+= $t.cc
.endfor
.for t in ${GTEST_REQ_TESTS}
GTESTS+= $t
LIBADD.$t+= gtest
SRCS.$t+= $t.cc
.endfor
SRCS.sample1_unittest+= sample1.cc
SRCS.sample2_unittest+= sample2.cc
SRCS.sample4_unittest+= sample4.cc
SRCS.sample5_unittest+= sample1.cc
.include <bsd.test.mk>