diff mbox series

[RFC,3/5] .travis.yml: add gcovr summary for GCOV build

Message ID 20180620132032.12952-4-alex.bennee@linaro.org
State New
Headers show
Series Tweak code coverage reporting | expand

Commit Message

Alex Bennée June 20, 2018, 1:20 p.m. UTC
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.

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>

---
 .travis.yml | 3 +++
 1 file changed, 3 insertions(+)

-- 
2.17.1

Comments

Philippe Mathieu-Daudé June 20, 2018, 8:30 p.m. UTC | #1
On 06/20/2018 10:20 AM, Alex Bennée wrote:
> 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.

> 

> 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>

> ---

>  .travis.yml | 3 +++

>  1 file changed, 3 insertions(+)

> 

> diff --git a/.travis.yml b/.travis.yml

> index fabfe9ec34..83e0577464 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:

> @@ -81,6 +82,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:

> +        - gcovr -p  | grep -v "0%" | sed s/[0-9]\*[,-]//g


Can we use 'fgrep -B 1 -v "0%"' (--before-context=1) to also remove the
filepath line?

Any idea why I get this? "(WARNING) Unrecognized GCOV output: '====='"

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


>        compiler: gcc

>      # We manually include builds which we disable "make check" for

>      - env: CONFIG="--enable-debug --enable-tcg-interpreter"

>
Philippe Mathieu-Daudé June 20, 2018, 8:46 p.m. UTC | #2
On 06/20/2018 10:20 AM, Alex Bennée wrote:
> 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.

> 

> 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>

> ---

>  .travis.yml | 3 +++

>  1 file changed, 3 insertions(+)

> 

> diff --git a/.travis.yml b/.travis.yml

> index fabfe9ec34..83e0577464 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:

> @@ -81,6 +82,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"


I just noticed the linux-user tests are not covered.

I'd duplicate this entry and use --disable-system --disable-bsd-user.

> +      after_success:

> +        - gcovr -p  | grep -v "0%" | sed s/[0-9]\*[,-]//g

>        compiler: gcc

>      # We manually include builds which we disable "make check" for

>      - env: CONFIG="--enable-debug --enable-tcg-interpreter"

>
Alex Bennée June 20, 2018, 9:04 p.m. UTC | #3
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> On 06/20/2018 10:20 AM, Alex Bennée wrote:

>> 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.

>>

>> 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>

>> ---

>>  .travis.yml | 3 +++

>>  1 file changed, 3 insertions(+)

>>

>> diff --git a/.travis.yml b/.travis.yml

>> index fabfe9ec34..83e0577464 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:

>> @@ -81,6 +82,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"

>

> I just noticed the linux-user tests are not covered.


I did try and calculate coverage of a risu run through SVE and didn't
get any gcda files so I think there is something else that needs adding
first.

>

> I'd duplicate this entry and use --disable-system --disable-bsd-user.

>

>> +      after_success:

>> +        - gcovr -p  | grep -v "0%" | sed s/[0-9]\*[,-]//g

>>        compiler: gcc

>>      # We manually include builds which we disable "make check" for

>>      - env: CONFIG="--enable-debug --enable-tcg-interpreter"

>>



--
Alex Bennée
diff mbox series

Patch

diff --git a/.travis.yml b/.travis.yml
index fabfe9ec34..83e0577464 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:
@@ -81,6 +82,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:
+        - gcovr -p  | grep -v "0%" | sed s/[0-9]\*[,-]//g
       compiler: gcc
     # We manually include builds which we disable "make check" for
     - env: CONFIG="--enable-debug --enable-tcg-interpreter"