From: "Alex Bennée" <alex.bennee@linaro.org>
To: cota@braap.org, famz@redhat.com, berrange@redhat.com,
f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com,
aurelien@aurel32.net, agraf@suse.de
Cc: qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>
Subject: [Qemu-devel] [PATCH v1 06/10] travis: add gcovr summary for GCOV build
Date: Mon, 25 Jun 2018 12:19:31 +0100 [thread overview]
Message-ID: <20180625111935.26108-7-alex.bennee@linaro.org> (raw)
In-Reply-To: <20180625111935.26108-1-alex.bennee@linaro.org>
This gives a more useful summary, sorted by descending % coverage,
after the tests have run. The final numbers will give an idea if our
coverage is getting better or worse.
To keep the width sane we need to post process the file that the old
gcovr tool generates. This is done with a mix of sed, awk and column
in the scripts/coverage-summary.sh script.
As quite a lot of lines don't get covered at all we filter out all the
0% lines. If the file doesn't appear it is not being exercised.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
v2
- pushed finagling into scripts/coverage-summary.sh
- dropped r-b as a big change
---
.travis.yml | 3 +++
scripts/coverage-summary.sh | 27 +++++++++++++++++++++++++++
2 files changed, 30 insertions(+)
create mode 100755 scripts/coverage-summary.sh
diff --git a/.travis.yml b/.travis.yml
index 32188d51f1..aa850c913c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -38,6 +38,7 @@ addons:
- libvte-2.90-dev
- sparse
- uuid-dev
+ - gcovr
# The channel name "irc.oftc.net#qemu" is encrypted against qemu/qemu
# to prevent IRC notifications from forks. This was created using:
@@ -86,6 +87,8 @@ matrix:
compiler: clang
# gprof/gcov are GCC features
- env: CONFIG="--enable-gprof --enable-gcov --disable-pie --target-list=aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,ppc64-softmmu,riscv64-softmmu,s390x-softmmu,x86_64-softmmu"
+ after_success:
+ - ${SRC_DIR}/scripts/coverage-summary.sh
compiler: gcc
# We manually include builds which we disable "make check" for
- env: CONFIG="--enable-debug --enable-tcg-interpreter"
diff --git a/scripts/coverage-summary.sh b/scripts/coverage-summary.sh
new file mode 100755
index 0000000000..d7086cf9ca
--- /dev/null
+++ b/scripts/coverage-summary.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Author: Alex Bennée <alex.bennee@linaro.org>
+#
+# Summerise the state of code coverage with gcovr and tweak the output
+# to be more sane on Travis hosts. As we expect to be executed on a
+# throw away CI instance we do spam temp files all over the shop. You
+# most likely don't want to execute this script but just call gcovr
+# directly. See also "make coverage-report"
+#
+# This code is licensed under the GPL version 2 or later. See
+# the COPYING file in the top-level directory.
+
+# first generate the coverage report
+gcovr -p -o raw-report.txt
+
+# strip the full-path and line markers
+sed s@$PWD\/@@ raw-report.txt | sed s/[0-9]\*[,-]//g > simplified.txt
+
+# reflow lines that got split
+awk '/.[ch]$/ { printf("%s", $0); next } 1' simplified.txt > rejoined.txt
+
+# columnify
+column -t rejoined.txt > final.txt
+
+# and dump, stripping out 0% coverage
+grep -v "0%" final.txt
--
2.17.1
next prev parent reply other threads:[~2018-06-25 11:19 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-25 11:19 [Qemu-devel] [PATCH v1 00/10] Travis updates and code coverage tweaks Alex Bennée
2018-06-25 11:19 ` [Qemu-devel] [PATCH v1 01/10] travis: do not waste time cloning unused submodules Alex Bennée
2018-06-29 11:41 ` Daniel P. Berrangé
2018-06-25 11:19 ` [Qemu-devel] [PATCH v1 02/10] travis: test out-of-tree builds Alex Bennée
2018-06-29 11:42 ` Daniel P. Berrangé
2018-06-25 11:19 ` [Qemu-devel] [PATCH v1 03/10] build-system: remove per-test GCOV reporting Alex Bennée
2018-06-29 11:43 ` Daniel P. Berrangé
2018-06-25 11:19 ` [Qemu-devel] [PATCH v1 04/10] .gitignore: add .gcov files Alex Bennée
2018-06-29 11:43 ` Daniel P. Berrangé
2018-06-25 11:19 ` [Qemu-devel] [PATCH v1 05/10] docker: add gcovr to travis image Alex Bennée
2018-06-25 11:32 ` Philippe Mathieu-Daudé
2018-06-29 11:44 ` Daniel P. Berrangé
2018-06-25 11:19 ` Alex Bennée [this message]
2018-06-29 11:45 ` [Qemu-devel] [PATCH v1 06/10] travis: add gcovr summary for GCOV build Daniel P. Berrangé
2018-06-25 11:19 ` [Qemu-devel] [PATCH v1 07/10] build-system: add clean-coverage target Alex Bennée
2018-06-29 11:46 ` Daniel P. Berrangé
2018-06-25 11:19 ` [Qemu-devel] [PATCH v1 08/10] build-system: add coverage-report target Alex Bennée
2018-06-29 11:48 ` Daniel P. Berrangé
2018-06-25 11:19 ` [Qemu-devel] [PATCH v1 09/10] linux-user: introduce preexit_cleanup Alex Bennée
2018-06-25 11:34 ` Philippe Mathieu-Daudé
2018-06-29 11:48 ` Daniel P. Berrangé
2018-06-29 14:22 ` Laurent Vivier
2018-06-25 11:19 ` [Qemu-devel] [PATCH v1 10/10] linux-user: add gcov support to preexit_cleanup Alex Bennée
2018-06-25 11:38 ` Philippe Mathieu-Daudé
2018-06-25 12:47 ` Alex Bennée
2018-07-02 2:04 ` [Qemu-devel] [PATCH v1 00/10] Travis updates and code coverage tweaks no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180625111935.26108-7-alex.bennee@linaro.org \
--to=alex.bennee@linaro.org \
--cc=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=balrogg@gmail.com \
--cc=berrange@redhat.com \
--cc=cota@braap.org \
--cc=f4bug@amsat.org \
--cc=famz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).