Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another gtest fix #846

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,33 @@ check_LTLIBRARIES = libgtest.la libgtest_main.la libgmock_main.la

# Note: Use at least 1.10 as we need googlemock, too.
GOOGLETEST_MIN_VERSION = 1.10.0
GOOGLETEST_DIR = googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest
GOOGLEMOCK_DIR = googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock

libgtest_la_CPPFLAGS = -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/include
libgtest_la_SOURCES = googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/src/gtest-all.cc
libgtest_la_CPPFLAGS = -I$(GOOGLETEST_DIR) -I$(GOOGLETEST_DIR)/include
libgtest_la_SOURCES = $(GOOGLETEST_DIR)/src/gtest-all.cc

libgtest_main_la_CPPFLAGS = -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/include
libgtest_main_la_SOURCES = googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/src/gtest_main.cc
libgtest_la_CPPFLAGS = -I$(GOOGLETEST_DIR) -I$(GOOGLETEST_DIR)/include
libgtest_la_SOURCES = $(GOOGLETEST_DIR)/src/gtest-all.cc

libgtest_main_la_CPPFLAGS = -I$(GOOGLETEST_DIR) -I$(GOOGLETEST_DIR)/include
libgtest_main_la_SOURCES = $(GOOGLETEST_DIR)/src/gtest_main.cc
libgtest_main_la_LIBADD = libgtest.la

libgmock_main_la_CPPFLAGS = -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock/include -I$(srcdir)/googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/include
libgmock_main_la_SOURCES = googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock/src/gmock-all.cc googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock/src/gmock_main.cc
libgmock_main_la_CPPFLAGS = -I$(GOOGLEMOCK_DIR) -I$(GOOGLEMOCK_DIR)/include -I$(GOOGLETEST_DIR)/include
libgmock_main_la_SOURCES = $(GOOGLEMOCK_DIR)/src/gmock-all.cc $(GOOGLEMOCK_DIR)/src/gmock_main.cc

# Hack: auto-download googletest.

googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/src/gtest-all.cc \
googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest/src/gtest_main.cc \
googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock/src/gmock-all.cc \
googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock/src/gmock_main.cc: setup_gtest
GOOGLE_TEST_SOURCES = \
$(GOOGLETEST_DIR)/src/gtest-all.cc \
$(GOOGLETEST_DIR)/src/gtest_main.cc \
$(GOOGLEMOCK_DIR)/src/gmock-all.cc \
$(GOOGLEMOCK_DIR)/src/gmock_main.cc

BUILT_SOURCES = $(GOOGLE_TEST_SOURCES)

$(GOOGLE_TEST_SOURCES): setup_gtest

setup_gtest:
curl https://codeload.github.com/google/googletest/zip/release-$(GOOGLETEST_MIN_VERSION) -o gtest-$(GOOGLETEST_MIN_VERSION).zip
Expand Down
9 changes: 7 additions & 2 deletions test/Makefile.inc
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# TODO: Unify with Makefile.am (or maybe autodetect)
GOOGLETEST_MIN_VERSION = 1.10.0
GOOGLETEST_DIR = googletest-release-$(GOOGLETEST_MIN_VERSION)/googletest
GOOGLEMOCK_DIR = googletest-release-$(GOOGLETEST_MIN_VERSION)/googlemock

#
# Include paths
#
COMMON_TEST_INCLUDES = \
-I$(top_srcdir)/test/common \
-I$(top_srcdir)/test/googletest-release-1.10.0/googlemock/include \
-I$(top_srcdir)/test/googletest-release-1.10.0/googletest/include
-I$(top_builddir)/test/$(GOOGLEMOCK_DIR)/include \
-I$(top_builddir)/test/$(GOOGLETEST_DIR)/include

COMMON_BASE_TEST_LIBS = \
$(top_builddir)/libredex.la \
Expand Down