[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 011/142] meson: use coverage option
From: |
Paolo Bonzini |
Subject: |
[PATCH 011/142] meson: use coverage option |
Date: |
Tue, 28 Jan 2020 18:51:31 +0100 |
From: Marc-André Lureau <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
---
Makefile | 14 --------------
Makefile.target | 16 ----------------
configure | 10 ++--------
docs/devel/testing.rst | 7 +++----
4 files changed, 5 insertions(+), 42 deletions(-)
diff --git a/Makefile b/Makefile
index 3b127ef5c8..9aa0808649 100644
--- a/Makefile
+++ b/Makefile
@@ -692,14 +692,6 @@ module_block.h:
$(SRC_PATH)/scripts/modules/module_block.py config-host.mak
$(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \
"GEN","$@")
-ifdef CONFIG_GCOV
-.PHONY: clean-coverage
-clean-coverage:
- $(call quiet-command, \
- find . \( -name '*.gcda' -o -name '*.gcov' \) -type f -exec rm
{} +, \
- "CLEAN", "coverage files")
-endif
-
clean: recurse-clean
# avoid old build problems by removing potentially incorrect old files
rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h
gen-op-arm.h
@@ -1170,9 +1162,6 @@ endif
echo '')
@echo 'Cleaning targets:'
@echo ' clean - Remove most generated files but keep the
config'
-ifdef CONFIG_GCOV
- @echo ' clean-coverage - Remove coverage files'
-endif
@echo ' distclean - Remove all generated files'
@echo ' dist - Build a distributable tarball'
@echo ''
@@ -1184,9 +1173,6 @@ endif
@echo 'Documentation targets:'
@echo ' html info pdf txt'
@echo ' - Build documentation in specified format'
-ifdef CONFIG_GCOV
- @echo ' coverage-report - Create code coverage report'
-endif
@echo ''
ifdef CONFIG_WIN32
@echo 'Windows targets:'
diff --git a/Makefile.target b/Makefile.target
index 6e61f607b1..3bb5d75eb9 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -240,19 +240,3 @@ endif
generated-files-y += config-target.h
Makefile: $(generated-files-y)
-
-# Reports/Analysis
-#
-# The target specific coverage report only cares about target specific
-# blobs and not the shared code.
-#
-
-%/coverage-report.html:
- @mkdir -p $*
- $(call quiet-command,\
- gcovr -r $(SRC_PATH) --object-directory $(CURDIR) \
- -p --html --html-details -o $@, \
- "GEN", "coverage-report.html")
-
-.PHONY: coverage-report
-coverage-report: $(CURDIR)/reports/coverage/coverage-report.html
diff --git a/configure b/configure
index a9ab67bf26..c3409938f2 100755
--- a/configure
+++ b/configure
@@ -418,7 +418,6 @@ tcg_interpreter="no"
bigendian="no"
mingw32="no"
gcov="no"
-gcov_tool="gcov"
EXESUF=""
DSOSUF=".so"
LDFLAGS_SHARED="-shared"
@@ -980,8 +979,6 @@ for opt do
;;
--meson=*) meson="$optarg"
;;
- --gcov=*) gcov_tool="$optarg"
- ;;
--smbd=*) smbd="$optarg"
;;
--extra-cflags=*)
@@ -1739,7 +1736,6 @@ Advanced options (experts only):
--with-coroutine=BACKEND coroutine backend. Supported options:
ucontext, sigaltstack, windows
--enable-gcov enable test coverage analysis with gcov
- --gcov=GCOV use specified gcov [$gcov_tool]
--disable-blobs disable installing provided firmware blobs
--with-vss-sdk=SDK-path enable Windows VSS support in QEMU Guest Agent
--with-win-sdk=SDK-path path to Windows Platform SDK (to build VSS .tlb)
@@ -6111,8 +6107,7 @@ esac
write_c_skeleton
if test "$gcov" = "yes" ; then
- CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS"
- LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS"
+ :
elif test "$fortify_source" = "yes" ; then
CFLAGS="-O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
elif test "$debug" = "no"; then
@@ -6587,7 +6582,6 @@ echo "debug stack usage $debug_stack_usage"
echo "mutex debugging $debug_mutex"
echo "crypto afalg $crypto_afalg"
echo "GlusterFS support $glusterfs"
-echo "gcov $gcov_tool"
echo "gcov enabled $gcov"
echo "TPM support $tpm"
echo "libssh support $libssh"
@@ -7537,7 +7531,6 @@ echo "TASN1_CFLAGS=$tasn1_cflags" >> $config_host_mak
echo "POD2MAN=$POD2MAN" >> $config_host_mak
if test "$gcov" = "yes" ; then
echo "CONFIG_GCOV=y" >> $config_host_mak
- echo "GCOV=$gcov_tool" >> $config_host_mak
fi
if test "$libudev" != "no"; then
@@ -8125,6 +8118,7 @@ NINJA=$PWD/ninjatool $python $meson setup \
$(test "$strip_opt" = yes && echo --strip) \
--buildtype $(if test "$debug" = yes; then echo debug; else echo
debugoptimized; fi) \
-Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \
+ -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false;
fi) \
$cross_arg \
"$PWD" "$source_path"
diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
index ab5be0c729..053ce37da2 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -163,13 +163,12 @@ instrumenting the tested code. To use it, configure QEMU
with
``--enable-gcov`` option and build. Then run ``make check`` as usual.
If you want to gather coverage information on a single test the ``make
-clean-coverage`` target can be used to delete any existing coverage
+clean-gcda`` target can be used to delete any existing coverage
information before running a single test.
You can generate a HTML coverage report by executing ``make
-coverage-report`` which will create
-./reports/coverage/coverage-report.html. If you want to create it
-elsewhere simply execute ``make /foo/bar/baz/coverage-report.html``.
+coverage-html`` which will create
+``meson-logs/coveragereport/index.html``.
Further analysis can be conducted by running the ``gcov`` command
directly on the various .gcda output files. Please read the ``gcov``
--
2.21.0
- [PATCH 002/142] optionrom: simplify Makefile, (continued)
- [PATCH 002/142] optionrom: simplify Makefile, Paolo Bonzini, 2020/01/28
- [PATCH 003/142] pc-bios/s390-ccw: simplify Makefile, Paolo Bonzini, 2020/01/28
- [PATCH 004/142] build-sys hack: ensure target directory is there, Paolo Bonzini, 2020/01/28
- [PATCH 001/142] minikconf: accept alnum identifiers, Paolo Bonzini, 2020/01/28
- [PATCH 005/142] configure: do not include $(...) variables in config-host.mak, Paolo Bonzini, 2020/01/28
- [PATCH 006/142] configure: expand path variables for meson configure, Paolo Bonzini, 2020/01/28
- [PATCH 008/142] configure: generate Meson cross file, Paolo Bonzini, 2020/01/28
- [PATCH 010/142] meson: enable pie, Paolo Bonzini, 2020/01/28
- [PATCH 009/142] build-sys: add meson submodule, Paolo Bonzini, 2020/01/28
- [PATCH 007/142] configure: integrate Meson in the build system, Paolo Bonzini, 2020/01/28
- [PATCH 011/142] meson: use coverage option,
Paolo Bonzini <=
- [PATCH 012/142] meson: add testsuite Makefile generator, Paolo Bonzini, 2020/01/28
- [PATCH 014/142] meson: add remaining generated tcg trace helpers, Paolo Bonzini, 2020/01/28
- [PATCH 016/142] contrib/libvhost-user: convert to Meson, Paolo Bonzini, 2020/01/28
- [PATCH 015/142] meson: add version.o, Paolo Bonzini, 2020/01/28
- [PATCH 017/142] contrib/vhost-user-blk: convert to Meson, Paolo Bonzini, 2020/01/28
- [PATCH 018/142] contrib/vhost-user-scsi: convert to Meson, Paolo Bonzini, 2020/01/28
- [PATCH 019/142] contrib/rdmacm-mux: convert to Meson, Paolo Bonzini, 2020/01/28
- [PATCH 020/142] contrib/vhost-user-input: convert to meson, Paolo Bonzini, 2020/01/28
- [PATCH 013/142] libqemuutil: convert to meson, Paolo Bonzini, 2020/01/28
- [PATCH 021/142] contrib/vhost-user-gpu: convert to meson, Paolo Bonzini, 2020/01/28