You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-commits@axis.apache.org by bi...@apache.org on 2018/01/07 19:43:27 UTC

svn commit: r1820480 - in /axis/axis2/c/core/trunk/axiom: Makefile.am configure.ac gtest/ gtest/Makefile.am test/om/Makefile.am test/om/test_om.c test/om/test_om.cc

Author: billblough
Date: Sun Jan  7 19:43:27 2018
New Revision: 1820480

URL: http://svn.apache.org/viewvc?rev=1820480&view=rev
Log:
Add gtest support for axiom

Added:
    axis/axis2/c/core/trunk/axiom/gtest/
    axis/axis2/c/core/trunk/axiom/gtest/Makefile.am   (with props)
    axis/axis2/c/core/trunk/axiom/test/om/test_om.cc
      - copied, changed from r1820434, axis/axis2/c/core/trunk/axiom/test/om/test_om.c
Removed:
    axis/axis2/c/core/trunk/axiom/test/om/test_om.c
Modified:
    axis/axis2/c/core/trunk/axiom/Makefile.am
    axis/axis2/c/core/trunk/axiom/configure.ac
    axis/axis2/c/core/trunk/axiom/test/om/Makefile.am

Modified: axis/axis2/c/core/trunk/axiom/Makefile.am
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/Makefile.am?rev=1820480&r1=1820479&r2=1820480&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/Makefile.am (original)
+++ axis/axis2/c/core/trunk/axiom/Makefile.am Sun Jan  7 19:43:27 2018
@@ -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

Modified: axis/axis2/c/core/trunk/axiom/configure.ac
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/configure.ac?rev=1820480&r1=1820479&r2=1820480&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/configure.ac (original)
+++ axis/axis2/c/core/trunk/axiom/configure.ac Sun Jan  7 19:43:27 2018
@@ -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-cove
     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 \

Added: axis/axis2/c/core/trunk/axiom/gtest/Makefile.am
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/gtest/Makefile.am?rev=1820480&view=auto
==============================================================================
--- axis/axis2/c/core/trunk/axiom/gtest/Makefile.am (added)
+++ axis/axis2/c/core/trunk/axiom/gtest/Makefile.am Sun Jan  7 19:43:27 2018
@@ -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
+

Propchange: axis/axis2/c/core/trunk/axiom/gtest/Makefile.am
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: axis/axis2/c/core/trunk/axiom/test/om/Makefile.am
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/test/om/Makefile.am?rev=1820480&r1=1820479&r2=1820480&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/test/om/Makefile.am (original)
+++ axis/axis2/c/core/trunk/axiom/test/om/Makefile.am Sun Jan  7 19:43:27 2018
@@ -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

Copied: axis/axis2/c/core/trunk/axiom/test/om/test_om.cc (from r1820434, axis/axis2/c/core/trunk/axiom/test/om/test_om.c)
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/test/om/test_om.cc?p2=axis/axis2/c/core/trunk/axiom/test/om/test_om.cc&p1=axis/axis2/c/core/trunk/axiom/test/om/test_om.c&r1=1820434&r2=1820480&rev=1820480&view=diff
==============================================================================
    (empty)