Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2019 07:29:50 +0000 (UTC)
From:      Enji Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r344345 - projects/import-googletest-1.8.1/lib/googletest/gtest/tests
Message-ID:  <201902200729.x1K7ToXS026198@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Wed Feb 20 07:29:50 2019
New Revision: 344345
URL: https://svnweb.freebsd.org/changeset/base/344345

Log:
  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.

Modified:
  projects/import-googletest-1.8.1/lib/googletest/gtest/tests/Makefile

Modified: projects/import-googletest-1.8.1/lib/googletest/gtest/tests/Makefile
==============================================================================
--- projects/import-googletest-1.8.1/lib/googletest/gtest/tests/Makefile	Wed Feb 20 07:21:22 2019	(r344344)
+++ projects/import-googletest-1.8.1/lib/googletest/gtest/tests/Makefile	Wed Feb 20 07:29:50 2019	(r344345)
@@ -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=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902200729.x1K7ToXS026198>