summaryrefslogtreecommitdiff
path: root/lib/googletest
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2019-02-20 07:29:50 +0000
committerEnji Cooper <ngie@FreeBSD.org>2019-02-20 07:29:50 +0000
commitdae8f2468df75c2d17c57bbb7253af88ab1f5d62 (patch)
tree4d965a5e71fa15fe56ff814093ce3cd91a0b892b /lib/googletest
parent7ea28b21e454f776d86d44fffe6941d8cf394b76 (diff)
downloadsrc-test2-dae8f2468df75c2d17c57bbb7253af88ab1f5d62.tar.gz
src-test2-dae8f2468df75c2d17c57bbb7253af88ab1f5d62.zip
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.
Notes
Notes: svn path=/projects/import-googletest-1.8.1/; revision=344345
Diffstat (limited to 'lib/googletest')
-rw-r--r--lib/googletest/gtest/tests/Makefile33
1 files changed, 22 insertions, 11 deletions
diff --git a/lib/googletest/gtest/tests/Makefile b/lib/googletest/gtest/tests/Makefile
index 25cf236772a0..0bdfb0202a86 100644
--- a/lib/googletest/gtest/tests/Makefile
+++ b/lib/googletest/gtest/tests/Makefile
@@ -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=