svn commit: r345038 - projects/import-googletest-1.8.1/share/examples/tests/tests/googletest
Enji Cooper
ngie at FreeBSD.org
Mon Mar 11 22:43:25 UTC 2019
Author: ngie
Date: Mon Mar 11 22:43:24 2019
New Revision: 345038
URL: https://svnweb.freebsd.org/changeset/base/345038
Log:
Tweak the examples integration
* Install the samples to the correct directory.
* Annotate with comments, like the other directories.
* Simplify the for loops; they were only needed for matching which tests
require `libgtest` instead of `libgtest_main`.
Modified:
projects/import-googletest-1.8.1/share/examples/tests/tests/googletest/Makefile
Modified: projects/import-googletest-1.8.1/share/examples/tests/tests/googletest/Makefile
==============================================================================
--- projects/import-googletest-1.8.1/share/examples/tests/tests/googletest/Makefile Mon Mar 11 22:42:33 2019 (r345037)
+++ projects/import-googletest-1.8.1/share/examples/tests/tests/googletest/Makefile Mon Mar 11 22:43:24 2019 (r345038)
@@ -1,5 +1,25 @@
# $FreeBSD$
+#
+# This Makefile differs from the other examples, in the sense that its purpose
+# is to install the upstream provided googletest sample unit tests.
+# The release package to use for the tests contained within the directory
+#
+# This applies to components which rely on ^/projects/release-pkg support
+# (see UPDATING XXXXXXXXX / svn revision r298107).
+PACKAGE= tests
+
+# Directory into which the Kyuafile provided by this directory will be
+# installed.
+#
+# This is always a subdirectory of ${TESTSBASE}/. The remainder of the
+# path has to match the relative path within the source tree in which
+# these files are found modulo the tests/ component at the end.
+#
+# For example: if this Makefile were in src/bin/cp/tests/, its TESTSDIR
+# would point at ${TESTSBASE}/bin/cp/.
+TESTSDIR= ${TESTSBASE}/share/examples/tests/googletest
+
.PATH: ${SRCTOP}/contrib/googletest/googletest/samples
GTEST_MAIN_REQ_TESTS+= sample1_unittest
@@ -16,18 +36,21 @@ GTEST_MAIN_REQ_TESTS+= sample8_unittest
#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
+# List of test programs to build. Note that we can build more than one
+# test from a single directory, and this is expected.
+GTESTS+= ${GTEST_MAIN_REQ_TESTS} ${GTEST_REQ_TESTS}
-.for t in ${GTEST_REQ_TESTS}
-GTESTS+= $t
+#
+.for t in ${GTESTS}
+.if ${GTEST_MAIN_REQ_TESTS:M$t}
+LIBADD.$t+= gtest_main
+.else
LIBADD.$t+= gtest
+.endif
SRCS.$t+= $t.cc
.endfor
+# Additional sources for sample testcase 1, 2, 4, and 5.
SRCS.sample1_unittest+= sample1.cc
SRCS.sample2_unittest+= sample2.cc
SRCS.sample4_unittest+= sample4.cc
More information about the svn-src-projects
mailing list