[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 021/150] meson: use coverage option
From: |
Paolo Bonzini |
Subject: |
[PATCH 021/150] meson: use coverage option |
Date: |
Mon, 17 Aug 2020 16:35:14 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 14 --------------
Makefile.target | 16 ----------------
configure | 9 ++-------
docs/devel/testing.rst | 7 +++----
meson.build | 2 +-
5 files changed, 6 insertions(+), 42 deletions(-)
diff --git a/Makefile b/Makefile
index bf66df5893..578aa99942 100644
--- a/Makefile
+++ b/Makefile
@@ -770,14 +770,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 ninja-clean clean-ctlist
-test -f ninjatool && ./ninjatool $(if $(V),-v,) -t clean
# avoid old build problems by removing potentially incorrect old files
@@ -1284,9 +1276,6 @@ endif
echo '')
@echo 'Cleaning targets:'
$(call print-help,clean,Remove most generated files but keep the config)
-ifdef CONFIG_GCOV
- $(call print-help,clean-coverage,Remove coverage files)
-endif
$(call print-help,distclean,Remove all generated files)
$(call print-help,dist,Build a distributable tarball)
@echo ''
@@ -1297,9 +1286,6 @@ endif
@echo ''
@echo 'Documentation targets:'
$(call print-help,html info pdf txt,Build documentation in specified
format)
-ifdef CONFIG_GCOV
- $(call print-help,coverage-report,Create code coverage report)
-endif
@echo ''
ifdef CONFIG_WIN32
@echo 'Windows targets:'
diff --git a/Makefile.target b/Makefile.target
index ffa2657269..d61a6a978b 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -269,19 +269,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 dcdf7312c8..9f20bf1d36 100755
--- a/configure
+++ b/configure
@@ -424,7 +424,6 @@ tcg_interpreter="no"
bigendian="no"
mingw32="no"
gcov="no"
-gcov_tool="gcov"
EXESUF=""
DSOSUF=".so"
LDFLAGS_SHARED="-shared"
@@ -1009,8 +1008,6 @@ for opt do
;;
--meson=*) meson="$optarg"
;;
- --gcov=*) gcov_tool="$optarg"
- ;;
--smbd=*) smbd="$optarg"
;;
--extra-cflags=*)
@@ -1817,7 +1814,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)
@@ -6551,8 +6547,7 @@ fi
write_c_skeleton
if test "$gcov" = "yes" ; then
- QEMU_CFLAGS="-fprofile-arcs -ftest-coverage -g $QEMU_CFLAGS"
- QEMU_LDFLAGS="-fprofile-arcs -ftest-coverage $QEMU_LDFLAGS"
+ :
elif test "$fortify_source" = "yes" ; then
QEMU_CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
debug=no
@@ -7837,7 +7832,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
@@ -8465,6 +8459,7 @@ NINJA=$PWD/ninjatool $meson setup \
-Dwerror=$(if test "$werror" = yes; then echo true; else echo false;
fi) \
-Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false;
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 c1ff24370b..a4264691be 100644
--- a/docs/devel/testing.rst
+++ b/docs/devel/testing.rst
@@ -164,13 +164,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``
diff --git a/meson.build b/meson.build
index d3b1f4b503..e6f9dfb070 100644
--- a/meson.build
+++ b/meson.build
@@ -199,7 +199,7 @@ summary_info += {'debug stack usage':
config_host.has_key('CONFIG_DEBUG_STACK_US
summary_info += {'mutex debugging':
config_host.has_key('CONFIG_DEBUG_MUTEX')}
summary_info += {'crypto afalg': config_host.has_key('CONFIG_AF_ALG')}
summary_info += {'GlusterFS support': config_host.has_key('CONFIG_GLUSTERFS')}
-summary_info += {'gcov': config_host.has_key('CONFIG_GCOV')}
+summary_info += {'gcov': get_option('b_coverage')}
summary_info += {'TPM support': config_host.has_key('CONFIG_TPM')}
summary_info += {'libssh support': config_host.has_key('CONFIG_LIBSSH')}
summary_info += {'QOM debugging':
config_host.has_key('CONFIG_QOM_CAST_DEBUG')}
--
2.26.2
- [PATCH 012/150] configure: expand path variables for meson configure, (continued)
- [PATCH 012/150] configure: expand path variables for meson configure, Paolo Bonzini, 2020/08/17
- [PATCH 013/150] configure: prepare CFLAGS/CXXFLAGS/LDFLAGS for Meson, Paolo Bonzini, 2020/08/17
- [PATCH 014/150] tests/vm: include setuptools, Paolo Bonzini, 2020/08/17
- [PATCH 016/150] configure: generate Meson cross file, Paolo Bonzini, 2020/08/17
- [PATCH 017/150] build-sys hack: link with whole .fa archives, Paolo Bonzini, 2020/08/17
- [PATCH 015/150] configure: integrate Meson in the build system, Paolo Bonzini, 2020/08/17
- [PATCH 020/150] meson: enable pie, Paolo Bonzini, 2020/08/17
- [PATCH 018/150] build-sys: add meson submodule, Paolo Bonzini, 2020/08/17
- [PATCH 022/150] meson: add sparse support, Paolo Bonzini, 2020/08/17
- [PATCH 019/150] meson: move summary to meson.build, Paolo Bonzini, 2020/08/17
- [PATCH 021/150] meson: use coverage option,
Paolo Bonzini <=
- [PATCH 023/150] meson: add testsuite Makefile generator, Paolo Bonzini, 2020/08/17
- [PATCH 025/150] meson: add remaining generated tcg trace helpers, Paolo Bonzini, 2020/08/17
- [PATCH 027/150] contrib/libvhost-user: convert to Meson, Paolo Bonzini, 2020/08/17
- [PATCH 028/150] tools/virtiofsd: convert to Meson, Paolo Bonzini, 2020/08/17
- [PATCH 024/150] libqemuutil, qapi, trace: convert to meson, Paolo Bonzini, 2020/08/17
- [PATCH 026/150] meson: add version.o, Paolo Bonzini, 2020/08/17
- [PATCH 029/150] contrib/vhost-user-blk: convert to Meson, Paolo Bonzini, 2020/08/17
- [PATCH 030/150] vhost-user-scsi: add compatibility for libiscsi 1.9.0, Paolo Bonzini, 2020/08/17
- [PATCH 032/150] contrib/rdmacm-mux: convert to Meson, Paolo Bonzini, 2020/08/17
- [PATCH 031/150] contrib/vhost-user-scsi: convert to Meson, Paolo Bonzini, 2020/08/17