Fix gtest test compilation and build more tests

My previous work to integrate these tests was incomplete/incorrect, because I
misunderstood how the cmake macros worked.

This addresses items with the gtest tests, which in turn fixes test compilation
and adds more tests which I had previously missed.

Due to an unknown issue with gtest_stress_test, I had to add pthread to LIBADD,
even though I shouldn't have added it to that (it was failing to link -lpthread
to libprivategtest.a). Add a XXX comment to note that something's awry there
and deserves additional investigation.
This commit is contained in:
Enji Cooper 2019-02-20 07:29:50 +00:00
parent 7ea28b21e4
commit dae8f2468d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/import-googletest-1.8.1/; revision=344345

View file

@ -4,6 +4,8 @@
.PATH: ${GOOGLETEST_SRCROOT}/src ${GOOGLETEST_SRCROOT}/test
GTESTS+= gtest-death-test_ex_catch_test
GTESTS+= gtest-death-test_ex_nocatch_test
GTESTS+= gtest_environment_test
GTESTS+= gtest_no_test_unittest
GTESTS+= googletest-param-test-test
@ -13,20 +15,29 @@ GTESTS+= gtest_stress_test
GTESTS+= gtest_throw_on_failure_ex_test
GTESTS+= gtest-unittest-api_test
SRCS.googletest-param-test-test+= googletest-param-test-test.cc
SRCS.googletest-param-test-test+= googletest-param-test2-test.cc
SRCS.gtest_premature_exit_test+= gtest_premature_exit_test.cc
.for test in ${GTESTS}
# XXX: linker error; no main(..)
#SRCS.${test}= gtest-all.cc
SRCS.${test}?= gtest_main.cc
.endfor
CXXFLAGS+= -I${GOOGLETEST_SRCROOT}/include
CXXFLAGS+= -I${GOOGLETEST_SRCROOT}
LIBADD= gtest
gtest-death-test_ex_catch_test.cc gtest-death-test_ex_nocatch_test.cc: googletest-death-test_ex_test.cc
${CP} ${.ALLSRC} ${.TARGET}
CXXFLAGS.gtest-death-test_ex_catch_test+= \
-DGTEST_ENABLE_CATCH_EXCEPTIONS_=1 \
-fexceptions
CXXFLAGS.gtest-death-test_ex_nocatch_test+= \
-DGTEST_ENABLE_CATCH_EXCEPTIONS_=0 \
-fexceptions
SRCS.googletest-param-test-test= \
googletest-param-test-test.cc \
googletest-param-test2-test.cc
LIBADD+= gtest
# XXX: explicitly listing -lpthread is incorrect. src.libnames.mk should be
# handling this.
LIBADD.gtest_stress_test+= pthread
# XXX: https://github.com/google/googletest/pull/2119
NO_WERROR=