mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-08 19:28:39 +00:00
build-sys: Add support for --enable-test-coverage to configure
Add support for --enable-test-coverage that sets additional CFLAGS and LDFLAGS. gcov creates files with suffixes .gcov, .gcno, and .gcda that we need clean up in a few directories. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
dc6e504522
commit
139925229d
@ -162,6 +162,10 @@ AC_ARG_ENABLE([fuzzer], AS_HELP_STRING([--enable-fuzzer], [Enable fuzzer]),
|
||||
AC_SUBST([SANITIZERS])
|
||||
AC_SUBST([FUZZER])
|
||||
|
||||
AC_ARG_ENABLE([test-coverage],
|
||||
AS_HELP_STRING([--enable-test-coverage], [Enable test coverage flags]),
|
||||
[COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage" COVERAGE_LDFLAGS="-fprofile-arcs"])
|
||||
|
||||
LT_INIT
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
@ -209,7 +213,8 @@ if test "x$enable_hardening" != "xno"; then
|
||||
fi
|
||||
|
||||
if test "$test_CFLAGS" != set; then
|
||||
CFLAGS="$CFLAGS -Wall -Werror -Wreturn-type -Wsign-compare -Wno-self-assign"
|
||||
CFLAGS="$CFLAGS $COVERAGE_CFLAGS -Wall -Werror -Wreturn-type -Wsign-compare -Wno-self-assign"
|
||||
LDFLAGS="$LDFLAGS $COVERAGE_LDFLAGS"
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES(Makefile \
|
||||
|
||||
@ -598,4 +598,17 @@ EXTRA_DIST = \
|
||||
libtpms.syms \
|
||||
test.syms
|
||||
|
||||
CLEANFILES = a.out
|
||||
CLEANFILES = \
|
||||
a.out \
|
||||
*.gcov \
|
||||
*.gcda \
|
||||
*.gcno \
|
||||
tpm12/*.gcov \
|
||||
tpm12/*.gcda \
|
||||
tpm12/*.gcno \
|
||||
tpm2/*.gcov \
|
||||
tpm2/*.gcda \
|
||||
tpm2/*.gcno \
|
||||
tpm2/crypto/openssl/*.gcov \
|
||||
tpm2/crypto/openssl/*.gcda \
|
||||
tpm2/crypto/openssl/*.gcno
|
||||
|
||||
@ -56,3 +56,8 @@ EXTRA_DIST = \
|
||||
common \
|
||||
tpm2_pcr_read.c \
|
||||
tpm2_pcr_read.sh
|
||||
|
||||
CLEANFILES = \
|
||||
*.gcov \
|
||||
*.gcda \
|
||||
*.gcno
|
||||
|
||||
Loading…
Reference in New Issue
Block a user