[CMake] CMake Coverage broken with Ninja

Gerhard Gappmeier gerhard.gappmeier at ascolab.com
Fri Sep 1 07:26:36 EDT 2017


hi all,

just recently I discovered that our coverage builds on CDash don't work
anymore.
By analyzing the problem I found out that this is related to Ninja
generator.
I don't know when the problem was introduced but it still exists with
CMake 3.9.1.
(GCC and gcov are version 4.9.4, but this is not important)

I attached a simple test program to reproduce the problem.

$> tar xf demo.tar.gz
$> cd demo
$> mkdir bld
$> cmake -GNinja ..
$> ninja Nightly
...
Configure project
   Each . represents 1024 bytes of output
    . Size of output: 0K
Build project
   Each symbol represents 1024 bytes of output.
   '!' represents an error and '*' a warning.
    . Size of output: 0K
   0 Compiler errors
   0 Compiler warnings
Test project /home/gergap/tmp/cmaketest/bld
    Start 1: mytest
1/1 Test #1: mytest ...........................   Passed    0.00 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.00 sec
Performing coverage
   Processing coverage (each . represents one file):
    .
   Accumulating results (each . represents one file):
    .Cannot find file: /home/gergap/tmp/cmaketest/bld/Testing/main.c

        Covered LOC:         0
        Not covered LOC:     0
        Total LOC:           0
        Percentage Coverage: 0.00%
...

When using make instead everything works as expected.
$> tar xf demo.tar.gz
$> cd demo
$> mkdir bld
$> cmake ..
$> make Nightly
Configure project
   Each . represents 1024 bytes of output
    . Size of output: 0K
Build project
   Each symbol represents 1024 bytes of output.
   '!' represents an error and '*' a warning.
    . Size of output: 0K
   0 Compiler errors
   0 Compiler warnings
Test project /home/gergap/tmp/cmaketest/bld
    Start 1: mytest
1/1 Test #1: mytest ...........................   Passed    0.00 sec

100% tests passed, 0 tests failed out of 1

Total Test time (real) =   0.00 sec
Performing coverage
   Processing coverage (each . represents one file):
    .
   Accumulating results (each . represents one file):
    .
        Covered LOC:         3
        Not covered LOC:     0
        Total LOC:           3
        Percentage Coverage: 100.00%

Is this problem known?
Are there any fixes/workaround available?

-- 
mit freundlichen Grüßen / best regards

*Gerhard Gappmeier*
ascolab GmbH - automation systems communication laboratory
Tel.: +49 911 569846 203
Fax: +49 911 569846 400
Web: http://www.ascolab.com
GPG-KeyId: 7A78B0A7
GPG-Fingerprint: A964 56A2 32E9 A537 AB7E EBD6 8D09 0D72 7A78 B0A7

--
*ascolab GmbH*
Geschäftsführer: Gerhard Gappmeier, Matthias Damm, Uwe Steinkrauß
Sitz der Gesellschaft: An der Kaufleite 34 • 90562 Kalchreuth • Germany
Registernummer: HRB 9360
Registergericht: Amtsgericht Fürth

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170901/e5c42c54/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demo.tar.gz
Type: application/gzip
Size: 517 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170901/e5c42c54/attachment.bin>


More information about the CMake mailing list