mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
merge bitcoin#19688: Add support for llvm-cov
This commit is contained in:
parent
6e4c9b5585
commit
9d227e82a0
2
.gitignore
vendored
2
.gitignore
vendored
@ -120,7 +120,9 @@ releases
|
|||||||
/*.info
|
/*.info
|
||||||
test_dash.coverage/
|
test_dash.coverage/
|
||||||
total.coverage/
|
total.coverage/
|
||||||
|
fuzz.coverage/
|
||||||
coverage_percent.txt
|
coverage_percent.txt
|
||||||
|
/cov_tool_wrapper.sh
|
||||||
|
|
||||||
#build tests
|
#build tests
|
||||||
linux-coverage-build
|
linux-coverage-build
|
||||||
|
10
Makefile.am
10
Makefile.am
@ -61,10 +61,10 @@ WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/dash.ico \
|
|||||||
OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_INSTALLER_ICONS) \
|
OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_INSTALLER_ICONS) \
|
||||||
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
|
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
|
||||||
|
|
||||||
COVERAGE_INFO = baseline.info \
|
COVERAGE_INFO = $(COV_TOOL_WRAPPER) baseline.info \
|
||||||
test_dash_filtered.info total_coverage.info \
|
test_dash_filtered.info total_coverage.info \
|
||||||
baseline_filtered.info functional_test.info functional_test_filtered.info \
|
baseline_filtered.info functional_test.info functional_test_filtered.info \
|
||||||
test_dash_coverage.info test_dash.info fuzz.info fuzz_coverage.info
|
test_dash_coverage.info test_dash.info fuzz.info fuzz_filtered.info fuzz_coverage.info
|
||||||
|
|
||||||
dist-hook:
|
dist-hook:
|
||||||
-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
|
-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
|
||||||
@ -171,7 +171,11 @@ LCOV_FILTER_PATTERN = \
|
|||||||
-p "src/secp256k1" \
|
-p "src/secp256k1" \
|
||||||
-p "depends"
|
-p "depends"
|
||||||
|
|
||||||
baseline.info:
|
$(COV_TOOL_WRAPPER):
|
||||||
|
@echo 'exec $(COV_TOOL) "$$@"' > $(COV_TOOL_WRAPPER)
|
||||||
|
@chmod +x $(COV_TOOL_WRAPPER)
|
||||||
|
|
||||||
|
baseline.info: $(COV_TOOL_WRAPPER)
|
||||||
$(LCOV) -c -i -d $(abs_builddir)/src -o $@
|
$(LCOV) -c -i -d $(abs_builddir)/src -o $@
|
||||||
|
|
||||||
baseline_filtered.info: baseline.info
|
baseline_filtered.info: baseline.info
|
||||||
|
30
configure.ac
30
configure.ac
@ -98,6 +98,7 @@ AC_PATH_TOOL(AR, ar)
|
|||||||
AC_PATH_TOOL(RANLIB, ranlib)
|
AC_PATH_TOOL(RANLIB, ranlib)
|
||||||
AC_PATH_TOOL(STRIP, strip)
|
AC_PATH_TOOL(STRIP, strip)
|
||||||
AC_PATH_TOOL(GCOV, gcov)
|
AC_PATH_TOOL(GCOV, gcov)
|
||||||
|
AC_PATH_TOOL(LLVM_COV, llvm-cov)
|
||||||
AC_PATH_PROG(LCOV, lcov)
|
AC_PATH_PROG(LCOV, lcov)
|
||||||
dnl Python 3.8 is specified in .python-version and should be used if available, see doc/dependencies.md
|
dnl Python 3.8 is specified in .python-version and should be used if available, see doc/dependencies.md
|
||||||
AC_PATH_PROGS([PYTHON], [python3.8 python3.9 python3.10 python3.11 python3.12 python3 python])
|
AC_PATH_PROGS([PYTHON], [python3.8 python3.9 python3.10 python3.11 python3.12 python3 python])
|
||||||
@ -810,16 +811,37 @@ if test x$use_lcov = xyes; then
|
|||||||
if test x$LCOV = x; then
|
if test x$LCOV = x; then
|
||||||
AC_MSG_ERROR("lcov testing requested but lcov not found")
|
AC_MSG_ERROR("lcov testing requested but lcov not found")
|
||||||
fi
|
fi
|
||||||
if test x$GCOV = x; then
|
|
||||||
AC_MSG_ERROR("lcov testing requested but gcov not found")
|
|
||||||
fi
|
|
||||||
if test x$PYTHON = x; then
|
if test x$PYTHON = x; then
|
||||||
AC_MSG_ERROR("lcov testing requested but python not found")
|
AC_MSG_ERROR("lcov testing requested but python not found")
|
||||||
fi
|
fi
|
||||||
if test x$GENHTML = x; then
|
if test x$GENHTML = x; then
|
||||||
AC_MSG_ERROR("lcov testing requested but genhtml not found")
|
AC_MSG_ERROR("lcov testing requested but genhtml not found")
|
||||||
fi
|
fi
|
||||||
LCOV="$LCOV --gcov-tool=$GCOV"
|
|
||||||
|
AC_MSG_CHECKING([whether compiler is Clang])
|
||||||
|
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
|
||||||
|
#if defined(__clang__) && defined(__llvm__)
|
||||||
|
// Compiler is Clang
|
||||||
|
#else
|
||||||
|
# error Compiler is not Clang
|
||||||
|
#endif
|
||||||
|
]])],[
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
if test x$LLVM_COV = x; then
|
||||||
|
AC_MSG_ERROR([lcov testing requested but llvm-cov not found])
|
||||||
|
fi
|
||||||
|
COV_TOOL="$LLVM_COV gcov"
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
if test x$GCOV = x; then
|
||||||
|
AC_MSG_ERROR([lcov testing requested but gcov not found])
|
||||||
|
fi
|
||||||
|
COV_TOOL="$GCOV"
|
||||||
|
])
|
||||||
|
AC_SUBST(COV_TOOL)
|
||||||
|
AC_SUBST(COV_TOOL_WRAPPER, "cov_tool_wrapper.sh")
|
||||||
|
LCOV="$LCOV --gcov-tool $(pwd)/$COV_TOOL_WRAPPER"
|
||||||
|
|
||||||
AX_CHECK_LINK_FLAG([[--coverage]], [LDFLAGS="$LDFLAGS --coverage"],
|
AX_CHECK_LINK_FLAG([[--coverage]], [LDFLAGS="$LDFLAGS --coverage"],
|
||||||
[AC_MSG_ERROR("lcov testing requested but --coverage linker flag does not work")])
|
[AC_MSG_ERROR("lcov testing requested but --coverage linker flag does not work")])
|
||||||
AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"],
|
AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"],
|
||||||
|
Loading…
Reference in New Issue
Block a user