aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2016-01-25 19:27:56 -0500
committerMike Frysinger <vapier@chromium.org>2016-01-25 19:27:56 -0500
commitf820ead9015e9cecb87fea62154b3f33da1baf20 (patch)
tree26cada78ec678f1f94ea3b99fe05dd870f26b013 /Makefile.am
parentbuild: clean up .dwo files (diff)
downloadbreakpad-f820ead9015e9cecb87fea62154b3f33da1baf20.tar.xz
test: allow use of system gmock/gtest libs
Some systems provide prebuilt copies of gmock/gtest (such as Chromium OS). Add a configure flag so they can take advantage of that. This allows for a smaller checkout as they don't need to include the full testing/ tree. BUG=chromium:579384 TEST=`make check` passes w/--enable-system-test-libs TEST=`make check` passes w/--disable-system-test-libs R=thestig@chromium.org Review URL: https://codereview.chromium.org/1638653002 .
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index e0a8b6ae..3fb2224d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -113,12 +113,17 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
## Common test logic
+if SYSTEM_TEST_LIBS
+TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS)
+TEST_LIBS = $(GTEST_LIBS) -lgtest_main $(GMOCK_LIBS)
+else
TEST_CFLAGS = \
-I$(top_srcdir)/src/testing/include \
-I$(top_srcdir)/src/testing/gtest/include \
-I$(top_srcdir)/src/testing/gtest \
-I$(top_srcdir)/src/testing
TEST_LIBS = src/testing/libtesting.a
+endif
## Libraries
check_LIBRARIES =
@@ -131,12 +136,14 @@ CLEANFILES =
check_LIBRARIES += src/testing/libtesting.a
+if !SYSTEM_TEST_LIBS
src_testing_libtesting_a_SOURCES = \
src/testing/gtest/src/gtest-all.cc \
src/testing/gtest/src/gtest_main.cc \
src/testing/src/gmock-all.cc
src_testing_libtesting_a_CPPFLAGS = \
$(AM_CPPFLAGS) $(TEST_CFLAGS)
+endif
if !DISABLE_PROCESSOR
lib_LIBRARIES += src/libbreakpad.a
@@ -519,7 +526,8 @@ src_client_linux_linux_client_unittest_LDFLAGS += \
endif
src_client_linux_linux_client_unittest_LDADD = \
- src/client/linux/linux_client_unittest_shlib
+ src/client/linux/linux_client_unittest_shlib \
+ $(TEST_LIBS)
src_client_linux_linux_client_unittest_DEPENDENCIES = \
src/client/linux/linux_client_unittest_shlib