Skip to content
Permalink
Browse files
Add gtest support for util
  • Loading branch information
bblough committed Apr 29, 2018
1 parent abfaba4 commit 335280da31c474797d5c4050b37b7959aca9e6aa
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
@@ -15,7 +15,7 @@
datadir=$(prefix)
tmpincludedir=$(prefix)/include/axis2-${PACKAGE_VERSION}/
includedir=$(prefix)/include/axis2-${PACKAGE_VERSION}/
SUBDIRS = src $(TESTDIR) include
SUBDIRS = src $(GTEST) $(TESTDIR) include
include_HEADERS=$(top_builddir)/include/*.h
tmpinclude_DATA=config.h
data_DATA= INSTALL README AUTHORS NEWS CREDITS LICENSE COPYING
@@ -25,6 +25,7 @@ AC_PREFIX_DEFAULT(/usr/local/axis2_util)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
@@ -239,6 +240,26 @@ AC_ARG_ENABLE(coverage, [ --enable-coverage
CPPFLAGS="$CPPFLAGS"]
)

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=yes],
@@ -302,12 +323,15 @@ AC_SUBST(ZLIBBUILD)
AC_SUBST(GUTHTHILA_DIR)
AC_SUBST(GUTHTHILA_LIBS)
AC_SUBST(TESTDIR)
AC_SUBST(GTEST_DIR)
AC_SUBST(GTEST)

AC_CONFIG_FILES([Makefile \
src/Makefile \
src/platforms/unix/Makefile \
src/minizip/Makefile \
include/Makefile \
gtest/Makefile \
test/Makefile \
test/util/Makefile \
test/allocator/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 335280d

Please sign in to comment.