mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 10:52:56 +01:00
Added code coverage checking
Signed-off-by: Mikko Koppanen <mkoppanen@php.net>
This commit is contained in:
parent
7af18468f8
commit
bdeddb89f7
32
acinclude.m4
32
acinclude.m4
@ -317,6 +317,38 @@ AC_DEFUN([AC_ZMQ_CHECK_ENABLE_DEBUG], [{
|
|||||||
fi
|
fi
|
||||||
}])
|
}])
|
||||||
|
|
||||||
|
dnl ##############################################################################
|
||||||
|
dnl # AC_ZMQ_WITH_GCOV([action-if-found], [action-if-not-found]) #
|
||||||
|
dnl # Check whether to build with code coverage #
|
||||||
|
dnl ##############################################################################
|
||||||
|
AC_DEFUN([AC_ZMQ_WITH_GCOV], [{
|
||||||
|
# Require compiler specifics
|
||||||
|
AC_REQUIRE([AC_ZMQ_CHECK_COMPILERS])
|
||||||
|
|
||||||
|
AC_ARG_WITH(gcov, [AS_HELP_STRING([--with-gcov=yes/no],
|
||||||
|
[With GCC Code Coverage reporting.])],
|
||||||
|
[ZMQ_GCOV="$withval"])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING(whether to enable code coverage)
|
||||||
|
|
||||||
|
if test "x$GXX" != "xyes"; then
|
||||||
|
AC_MSG_ERROR([--with-gcov=yes works only with GCC])
|
||||||
|
fi
|
||||||
|
|
||||||
|
CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
|
||||||
|
if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then
|
||||||
|
CFLAGS="${CFLAGS} ${ZMQ_ORIG_CFLAGS}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
CPPFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
|
||||||
|
if test "x${ZMQ_ORIG_CPPFLAGS}" != "xnone"; then
|
||||||
|
CPPFLAGS="${CPPFLAGS} ${ZMQ_ORIG_CPPFLAGS}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AS_IF([test "x$ZMQ_GCOV" = "xyes"],
|
||||||
|
[AC_MSG_RESULT(yes) ; $1], [AC_MSG_RESULT(no) ; $2])
|
||||||
|
}])
|
||||||
|
|
||||||
dnl ##############################################################################
|
dnl ##############################################################################
|
||||||
dnl # AC_ZMQ_CHECK_WITH_FLAG([flags], [macro]) #
|
dnl # AC_ZMQ_CHECK_WITH_FLAG([flags], [macro]) #
|
||||||
dnl # Runs a normal autoconf check with compiler flags #
|
dnl # Runs a normal autoconf check with compiler flags #
|
||||||
|
@ -57,6 +57,9 @@ AC_PROG_LIBTOOL
|
|||||||
# Check whether to build a with debug symbols
|
# Check whether to build a with debug symbols
|
||||||
AC_ZMQ_CHECK_ENABLE_DEBUG
|
AC_ZMQ_CHECK_ENABLE_DEBUG
|
||||||
|
|
||||||
|
# Check wheter to enable code coverage
|
||||||
|
AC_ZMQ_WITH_GCOV
|
||||||
|
|
||||||
# Checks for libraries.
|
# Checks for libraries.
|
||||||
AC_CHECK_LIB([pthread], [pthread_create])
|
AC_CHECK_LIB([pthread], [pthread_create])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user