mirror of
https://github.com/clearlinux/cve-check-tool.git
synced 2026-10-03 15:39:51 +00:00
Integrate initial make coverage target
This was essentially "borrowed" from Buxton Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This commit is contained in:
+6
-1
@@ -25,4 +25,9 @@ check_*.trs
|
||||
test-*.log
|
||||
.dirstamp
|
||||
check_jira_plugin
|
||||
check_packaging
|
||||
check_packaging
|
||||
|
||||
coverage/
|
||||
|
||||
*.gcno
|
||||
*.gcda
|
||||
+10
@@ -1,3 +1,5 @@
|
||||
include $(top_srcdir)/common.mk
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
EXTRA_DIST = ${top_srcdir}/README.md \
|
||||
@@ -14,3 +16,11 @@ SUBDIRS = \
|
||||
src \
|
||||
tests \
|
||||
docs
|
||||
|
||||
if COVERAGE
|
||||
coverage:
|
||||
mkdir -p coverage
|
||||
lcov --compat-libtool --directory . --capture --output-file coverage/report
|
||||
genhtml -o coverage/ coverage/report
|
||||
AM_CFLAGS += --coverage
|
||||
endif
|
||||
|
||||
@@ -23,6 +23,25 @@ PKG_CHECK_MODULES([CHECK], [check >= 0.9])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
have_coverage=no
|
||||
AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage]))
|
||||
if test "x$enable_coverage" = "xyes" ; then
|
||||
AC_CHECK_PROG(lcov_found, [lcov], [yes], [no])
|
||||
if test "x$lcov_found" = xno ; then
|
||||
AC_MSG_ERROR([*** lcov support requested but the program was not found])
|
||||
else
|
||||
lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
|
||||
lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
|
||||
if test "$lcov_version_major" -eq 1 -a "$lcov_version_minor" -lt 10; then
|
||||
AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
|
||||
else
|
||||
have_coverage=yes
|
||||
AC_DEFINE([COVERAGE], [1], [Coverage enabled])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL([COVERAGE], [test "$have_coverage" = "yes"])
|
||||
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
data/Makefile
|
||||
@@ -43,6 +62,8 @@ AC_MSG_RESULT([
|
||||
bindir: ${bindir}
|
||||
datarootdir: ${datarootdir}
|
||||
|
||||
coverage: ${have_coverage}
|
||||
|
||||
compiler: ${CC}
|
||||
cflags: ${CFLAGS}
|
||||
ldflags: ${LDFLAGS}
|
||||
|
||||
+5
-1
@@ -1,4 +1,8 @@
|
||||
-include $(top_srcdir)/common.mk
|
||||
include $(top_srcdir)/common.mk
|
||||
|
||||
if COVERAGE
|
||||
AM_CFLAGS += --coverage
|
||||
endif
|
||||
|
||||
bin_PROGRAMS = cve-check-tool
|
||||
|
||||
|
||||
+4
-1
@@ -1,5 +1,8 @@
|
||||
-include $(top_srcdir)/common.mk
|
||||
include $(top_srcdir)/common.mk
|
||||
|
||||
if COVERAGE
|
||||
AM_CFLAGS += --coverage
|
||||
endif
|
||||
|
||||
TESTS = \
|
||||
check_core \
|
||||
|
||||
Reference in New Issue
Block a user