aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am44
1 files changed, 41 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 30941d4f..8e9b61c3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -76,8 +76,18 @@ test_gmock_link_test_SOURCES = test/gmock_link_test.cc \
test/gmock_link_test.h
test_gmock_link_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la
+# Tests that fused gmock files compile and work.
+TESTS += test/gmock_fused_test
+check_PROGRAMS += test/gmock_fused_test
+test_gmock_fused_test_SOURCES = fused-src/gmock-gtest-all.cc \
+ fused-src/gmock_main.cc \
+ fused-src/gmock/gmock.h \
+ fused-src/gtest/gtest.h \
+ test/gmock_test.cc
+test_gmock_fused_test_CPPFLAGS = -I"$(srcdir)/fused-src"
+
# Google Mock source files that we don't compile directly.
-EXTRA_DIST += \
+GMOCK_SOURCE_INGLUDES = \
src/gmock.cc \
src/gmock-cardinalities.cc \
src/gmock-internal-utils.cc \
@@ -85,6 +95,8 @@ EXTRA_DIST += \
src/gmock-printers.cc \
src/gmock-spec-builders.cc
+EXTRA_DIST += $(GMOCK_SOURCE_INGLUDES)
+
# C++ tests that we don't compile using autotools.
EXTRA_DIST += \
test/gmock_all_test.cc \
@@ -99,8 +111,7 @@ EXTRA_DIST += \
test/gmock-more-actions_test.cc \
test/gmock-nice-strict_test.cc \
test/gmock-port_test.cc \
- test/gmock-printers_test.cc \
- test/gmock_test.cc
+ test/gmock-printers_test.cc
# Python tests, which we don't run using autotools.
EXTRA_DIST += \
@@ -152,3 +163,30 @@ EXTRA_DIST += \
msvc/gmock_main.vcproj \
msvc/gmock-spec-builders_test.vcproj \
msvc/gmock_test.vcproj
+
+# gmock_test.cc does not really depend on files generated by the
+# fused-gmock-internal rule. However, gmock_test.o does, and it is
+# important to include test/gmock_test.cc as part of this rule in order to
+# prevent compiling gmock_test.o until all dependent files have been
+# generated.
+$(test_gmock_fused_test_SOURCES): fused-gmock-internal
+
+# TODO(vladl@google.com): Find a way to add Google Tests's sources here.
+fused-gmock-internal: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \
+ $(lib_libgmock_la_SOURCES) $(GMOCK_SOURCE_INGLUDES) \
+ $(lib_libgmock_main_la_SOURCES) \
+ scripts/fuse_gmock_files.py
+ mkdir -p "$(srcdir)/fused-src"
+ chmod -R u+w "$(srcdir)/fused-src"
+ rm -f "$(srcdir)/fused-src/gtest/gtest.h"
+ rm -f "$(srcdir)/fused-src/gmock/gmock.h"
+ rm -f "$(srcdir)/fused-src/gmock-gtest-all.cc"
+ "$(srcdir)/scripts/fuse_gmock_files.py" "$(srcdir)/fused-src"
+ cp -f "$(srcdir)/src/gmock_main.cc" "$(srcdir)/fused-src"
+
+maintainer-clean-local:
+ rm -rf "$(srcdir)/fused-src"
+
+# Death tests may produce core dumps in the build directory. In case
+# this happens, clean them to keep distcleancheck happy.
+CLEANFILES = core