Skip to content
Permalink
Browse files
Add gtest support for axiom
  • Loading branch information
bblough committed Jan 7, 2018
1 parent 686d1be commit d6d4b741ad5e343be9cad0be844ae02809dab4d2
Showing 5 changed files with 57 additions and 10 deletions.
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
datadir=$(prefix)
SUBDIRS = src $(TESTDIR) include
SUBDIRS = src $(GTEST) $(TESTDIR) include
includedir=$(prefix)/include/axis2-${PACKAGE_VERSION}/
include_HEADERS=$(top_builddir)/include/*.h
data_DATA= INSTALL README AUTHORS NEWS CREDITS LICENSE COPYING
@@ -26,6 +26,7 @@ m4_include(pkg.m4)
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_LN_S
@@ -161,18 +162,44 @@ AC_ARG_ENABLE(coverage, [ --enable-coverage enable code coverage statisti
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"
CXXFLAGS="$CXXFLAGS"
;;
*)
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
CPPFLAGS="$CPPFLAGS -fprofile-arcs -ftest-coverage"
CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
LDFLAGS="$LDFLAGS -lgcov --coverage"
;;
esac ],[
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"]
CPPFLAGS="$CPPFLAGS"
CXXFLAGS="$CXXFLAGS"]
)

AC_MSG_CHECKING(whether to 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],
[ case "${enableval}" in
@@ -200,6 +227,8 @@ AC_SUBST(LIBXML2_LIBS)
AC_SUBST(WRAPPER_DIR)
AC_SUBST(GUTHTHILA_LIBS)
AC_SUBST(TESTDIR)
AC_SUBST(GTEST_DIR)
AC_SUBST(GTEST)
AC_SUBST(XPATH_DIR)

AC_CONFIG_FILES([Makefile \
@@ -212,6 +241,7 @@ AC_CONFIG_FILES([Makefile \
src/util/Makefile \
src/attachments/Makefile \
src/xpath/Makefile \
gtest/Makefile \
test/Makefile \
test/om/Makefile \
test/soap/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

@@ -12,17 +12,20 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
TESTS =
TESTS = test_om
noinst_PROGRAMS = test_om
check_PROGRAMS = test_om
SUBDIRS =
AM_CFLAGS = -g -O2
test_om_SOURCES = test_om.c

test_om_LDADD = ../../../util/src/libaxutil.la \
$(top_builddir)/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la \
$(top_builddir)/src/om/libaxis2_axiom.la
test_om_SOURCES = test_om.cc

INCLUDES = -I$(top_builddir)/include \
test_om_LDADD = ../../../util/src/libaxutil.la \
$(top_builddir)/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la \
$(top_builddir)/src/om/libaxis2_axiom.la \
$(top_builddir)/$(GTEST)/libgtest.a \
$(top_builddir)/$(GTEST)/libgtest_main.a

AM_CPPFLAGS = -I$(top_builddir)/include \
-I$(top_builddir)/src/parser \
-I ../../../util/include
-I ../../../util/include \
-I $(GTEST_DIR)/include
File renamed without changes.

0 comments on commit d6d4b74

Please sign in to comment.