From 1caf89bac7fe5975e8dbf8ff80824913aa7c8230 Mon Sep 17 00:00:00 2001 From: ngie Date: Thu, 21 Feb 2019 03:37:31 +0000 Subject: [PATCH] Build death tests programmatically The previous code hardcoded the death test build definitions in a duplicative manner. The new code doesn't. --- lib/googletest/gtest/tests/Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/googletest/gtest/tests/Makefile b/lib/googletest/gtest/tests/Makefile index 0bdfb0202a86..d090387db3bb 100644 --- a/lib/googletest/gtest/tests/Makefile +++ b/lib/googletest/gtest/tests/Makefile @@ -4,8 +4,6 @@ .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 @@ -18,16 +16,19 @@ GTESTS+= gtest-unittest-api_test CXXFLAGS+= -I${GOOGLETEST_SRCROOT}/include CXXFLAGS+= -I${GOOGLETEST_SRCROOT} -gtest-death-test_ex_catch_test.cc gtest-death-test_ex_nocatch_test.cc: googletest-death-test_ex_test.cc +.for death_test in gtest-death-test_ex_catch_test gtest-death-test_ex_nocatch_test +# XXX: copying source files in order to tweak CXXFLAGS seems hacky. +${death_test}.cc: googletest-death-test_ex_test.cc ${CP} ${.ALLSRC} ${.TARGET} +CLEANFILES+= ${death_test}.cc +CXXFLAGS.${death_test}+= -fexception +.endfor -CXXFLAGS.gtest-death-test_ex_catch_test+= \ - -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1 \ - -fexceptions +CXXFLAGS.gtest-death-test_ex_catch_test+= \ + -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1 CXXFLAGS.gtest-death-test_ex_nocatch_test+= \ - -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0 \ - -fexceptions + -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0 SRCS.googletest-param-test-test= \ googletest-param-test-test.cc \