1
0
mirror of https://github.com/Yubico/yubico-pam.git synced 2024-11-29 00:24:11 +01:00

add a --enable-coverage switch

This commit is contained in:
Klas Lindfors 2015-01-20 10:24:43 +01:00
parent e7fadcf073
commit de0eed5be4
4 changed files with 40 additions and 0 deletions

3
.gitignore vendored
View File

@ -53,3 +53,6 @@ tests/pam_test
tests/pam_test.log
tests/pam_test.o
tests/pam_test.trs
coverage/
tests/pam_test.gcno
ykpamcfg.gcno

View File

@ -79,6 +79,32 @@ SUFFIXES = .1.txt .1 .8.txt .8
.8.txt.8:
$(A2X) --format=manpage -a revdate="Version $(VERSION)" $<
if ENABLE_COV
AM_CFLAGS += --coverage
AM_LDFLAGS = --coverage
cov-reset:
rm -fr coverage
find . -name "*.gcda" -exec rm {} \;
lcov --directory . --zerocounters
cov-report:
mkdir -p coverage
lcov --compat-libtool --directory . --capture --output-file coverage/app.info
lcov --extract coverage/app.info '*.c' --output-file coverage/app2.info
genhtml -o coverage/ coverage/app2.info
cov:
make cov-report
clean-local:
make cov-reset
check:
make cov
endif
# Release
ChangeLog:

View File

@ -105,6 +105,13 @@ AC_ARG_WITH(pam-dir,
esac])
AC_MSG_NOTICE([PAM installation path $PAMDIR])
AC_ARG_ENABLE([coverage],
[AS_HELP_STRING([--enable-coverage],
[use Gcov to test the test suite])],
[],
[enable_cov=no])
AM_CONDITIONAL([ENABLE_COV],[test '!' "$enable_cov" = no])
AC_ARG_ENABLE([gcc-warnings],
[AS_HELP_STRING([--enable-gcc-warnings],
[turn on lots of GCC warnings (for developers)])],

View File

@ -36,3 +36,7 @@ pam_test_LDADD = ../libpam_real.la ../libpam_util.la @LTLIBYUBIKEY@ @LTLIBYKCLIE
check_PROGRAMS = test util_test pam_test
TESTS = $(check_PROGRAMS)
if ENABLE_COV
AM_LDFLAGS += --coverage
endif