Skip to content
Permalink
Browse files
Optionally enable code coverage statistics
Add configure/makefile support for enabling gcov-based test coverage statistics

JIRA: AXIS2C-1689
  • Loading branch information
bblough committed Jan 7, 2018
1 parent 2ca346c commit 938811984b2a82042f6b7d684cdbd82891298967
Showing 5 changed files with 101 additions and 0 deletions.
@@ -154,6 +154,24 @@ AC_ARG_ENABLE(libxml2, [ --enable-libxml2 build libxml2 xml parser library w
AC_MSG_RESULT(no)
)

AC_MSG_CHECKING(whether to enable code coverage statistics)
AC_ARG_ENABLE(coverage, [ --enable-coverage enable code coverage statistics (default=no)],
[ case "${enableval}" in
no)
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"
;;
*)
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
CPPFLAGS="$CPPFLAGS -fprofile-arcs -ftest-coverage"
;;
esac ],[
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"]
)

AC_MSG_CHECKING(whether to build tests)
AC_ARG_ENABLE(tests, [ --enable-tests build tests. default=no],
@@ -418,6 +418,26 @@ AC_ARG_ENABLE(trace, [ --enable-trace
CPPFLAGS="$CPPFLAGS"
)

AC_MSG_CHECKING(whether to enable code coverage statistics)
AC_ARG_ENABLE(coverage, [ --enable-coverage
enable code coverage statistics (default=no)],
[ case "${enableval}" in
no)
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"
;;
*)
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
CPPFLAGS="$CPPFLAGS -fprofile-arcs -ftest-coverage"
;;
esac ],[
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"]
)

AC_MSG_CHECKING(whether to enable multi threading)
AC_ARG_ENABLE(multi-thread, [ --enable-multi-thread
enable multi threaded axis2 worker (default=yes)],
@@ -67,6 +67,26 @@ if test "$GCC" = "yes"; then
CFLAGS="$CFLAGS -ansi -ggdb3 -Wall -Wno-implicit-function-declaration "
fi

AC_MSG_CHECKING(whether to enable code coverage statistics)
AC_ARG_ENABLE(coverage, [ --enable-coverage enable code coverage statistics (default=no)],
[ case "${enableval}" in
no)
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"
;;
*)
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
CPPFLAGS="$CPPFLAGS -fprofile-arcs -ftest-coverage"
;;
esac ],[
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"]
)



dnl Checks for header files.
AC_HEADER_STDC
@@ -109,6 +109,28 @@ AC_ARG_ENABLE(libxml2, [ --enable-libxml2
AC_MSG_RESULT(no)
)


AC_MSG_CHECKING(whether to enable code coverage statistics)
AC_ARG_ENABLE(coverage, [ --enable-coverage
enable code coverage statistics (default=no)],
[ case "${enableval}" in
no)
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"
;;
*)
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
CPPFLAGS="$CPPFLAGS -fprofile-arcs -ftest-coverage"
;;
esac ],[
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"]
)


dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdio.h stdlib.h string.h])
@@ -217,6 +217,27 @@ AC_ARG_ENABLE(trace, [ --enable-trace
CFLAGS="$CFLAGS"
)

AC_MSG_CHECKING(whether to enable code coverage statistics)
AC_ARG_ENABLE(coverage, [ --enable-coverage
enable code coverage statistics (default=no)],
[ case "${enableval}" in
no)
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"
;;
*)
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
CPPFLAGS="$CPPFLAGS -fprofile-arcs -ftest-coverage"
;;
esac ],[
AC_MSG_RESULT(no)
CFLAGS="$CFLAGS"
CPPFLAGS="$CPPFLAGS"]
)


AC_MSG_CHECKING(whether to build tests)
AC_ARG_ENABLE(tests, [ --enable-tests build tests. default=yes],
[ case "${enableval}" in

0 comments on commit 9388119

Please sign in to comment.