Skip to content
Permalink
Browse files
Add support for Google Test Framework
Add support for using out-of-tree copy of gtest by using the
--with-gtest=<path> configure flag, where <path> is the path to the 
gtest source directory.  The gtest libs will be compiled and copied into
the working tree.

JIRA: AXIS2C-1691
  • Loading branch information
bblough committed Jan 7, 2018
1 parent 51a433b commit 686d1be081599210ee2ffa1d44094c9532c66cea
Showing 3 changed files with 39 additions and 1 deletion.
@@ -22,7 +22,7 @@ wsdl2cdir=$(prefix)/bin/tools/wsdl2c
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = axis2c.pc

SUBDIRS = util $(GUTHTHILA_DIR) axiom neethi src $(TESTDIR) include ides tools/tcpmon tools/md5
SUBDIRS = $(GTEST) util $(GUTHTHILA_DIR) axiom neethi src $(TESTDIR) include ides tools/tcpmon tools/md5
include_HEADERS=$(top_builddir)/include/*.h
data_DATA= samples/server/axis2.xml README \
INSTALL CREDITS COPYING NEWS NOTICE AUTHORS
@@ -378,6 +378,27 @@ AC_ARG_WITH(apr,
AC_MSG_RESULT(no)
)

AC_MSG_CHECKING(whether to use use the Google test framework)
AC_ARG_WITH(gtest,
[ --with-gtest[=PATH] Find the gtest source files in 'PATH'.],
[ case "$withval" in
no)
AC_MSG_RESULT(no)
USE_GTEST=""
GTEST_DIR=""
GTEST=""
;;
*)
AC_MSG_RESULT(yes)
GTEST_DIR="$withval"
GTEST="gtest"
CXXFLAGS="$CXXFLAGS -g -Wall -Wextra -pthread"
;;
esac ],
AC_MSG_RESULT(no)
)


AC_MSG_CHECKING(whether to build tests)
AC_ARG_ENABLE(tests, [ --enable-tests
build tests (default=no)],
@@ -554,6 +575,8 @@ AC_SUBST(OPENSSLLIB)
AC_SUBST(APRINC)
AC_SUBST(DICLIENT_DIR)
AC_SUBST(TESTDIR)
AC_SUBST(GTEST_DIR)
AC_SUBST(GTEST)
AC_SUBST(SAMPLES)
AC_SUBST(APACHE2BUILD)
AC_SUBST(NTLM_CFLAGS)
@@ -624,6 +647,7 @@ AC_CONFIG_FILES([Makefile \
src/modules/Makefile \
src/modules/mod_addr/Makefile \
src/modules/mod_log/Makefile \
gtest/Makefile \
test/Makefile \
test/core/Makefile \
test/core/description/Makefile \
@@ -0,0 +1,14 @@

noinst_LIBRARIES = libgtest.a libgtest_main.a

libgtest_a_SOURCES = $(GTEST_DIR)/src/gtest-all.cc
libgtest_a_CPPFLAGS = -I$(GTEST_DIR)/include -I$(GTEST_DIR)
libgtest_a_CXXFLAGS = -g -Wall -Wextra
libgtest_a_LDFLAGS = -pthread

libgtest_main_a_SOURCES = $(GTEST_DIR)/src/gtest_main.cc
libgtest_main_CPPFLAGS = -I$(GTEST_DIR)/include -I$(GTEST_DIR)
libgtest_main_a_CXXFLAGS = -g -Wall -Wextra
libgtest_main_LDFLAGS = -pthread
libgtest_main_a_LIBADD = libgtest.a

0 comments on commit 686d1be

Please sign in to comment.