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