1#
2# This Makefile differs from the other examples, in the sense that its purpose
3# is to install the upstream provided googletest sample unit tests.
4
5# The release package to use for the tests contained within the directory
6#
7# This applies to components which rely on ^/projects/release-pkg support
8# (see UPDATING XXXXXXXXX / svn revision r298107).
9PACKAGE=	tests
10
11# Directory into which the Kyuafile provided by this directory will be
12# installed.
13#
14# This is always a subdirectory of ${TESTSBASE}/.  The remainder of the
15# path has to match the relative path within the source tree in which
16# these files are found modulo the tests/ component at the end.
17#
18# For example: if this Makefile were in src/bin/cp/tests/, its TESTSDIR
19# would point at ${TESTSBASE}/bin/cp/.
20TESTSDIR=	${TESTSBASE}/share/examples/tests/googletest
21
22.PATH: ${SRCTOP}/contrib/googletest/googletest/samples
23
24GTEST_MAIN_REQ_TESTS+=	sample1_unittest
25GTEST_MAIN_REQ_TESTS+=	sample2_unittest
26GTEST_MAIN_REQ_TESTS+=	sample3_unittest
27GTEST_MAIN_REQ_TESTS+=	sample4_unittest
28GTEST_MAIN_REQ_TESTS+=	sample5_unittest
29GTEST_MAIN_REQ_TESTS+=	sample6_unittest
30GTEST_MAIN_REQ_TESTS+=	sample7_unittest
31GTEST_MAIN_REQ_TESTS+=	sample8_unittest
32
33# sample9_unittest's `CustomOutputTest.Fails` fails intentionally to illustrate
34# how output format can be adjusted with command-line parameters.
35#GTEST_REQ_TESTS+=	sample9_unittest
36GTEST_REQ_TESTS+=	sample10_unittest
37
38# List of test programs to build.  Note that we can build more than one
39# test from a single directory, and this is expected.
40GTESTS+=		${GTEST_MAIN_REQ_TESTS} ${GTEST_REQ_TESTS}
41
42#
43.for t in ${GTESTS}
44.if ${GTEST_MAIN_REQ_TESTS:M$t}
45LIBADD.$t+=	gtest_main
46.else
47LIBADD.$t+=	gtest
48.endif
49SRCS.$t+=	$t.cc
50.endfor
51
52# Additional sources for sample testcase 1, 2, 4, and 5.
53SRCS.sample1_unittest+=	sample1.cc
54SRCS.sample2_unittest+=	sample2.cc
55SRCS.sample4_unittest+=	sample4.cc
56SRCS.sample5_unittest+=	sample1.cc
57
58.include <bsd.test.mk>
59