LCOV_EXCL_START / STOP no tiene efecto cuando se usa gcovr

Cuando agrego etiquetas LCOV_EXCL_START / STOP a mi código C ++, no parece tener ningún efecto en mi informe gcovr.

¿Alguien sabe por qué ocurre esto?

Tengo lo siguiente:

$ tree
.
├── build
├── include
│   └── a.h
└── tests
    └── test_a.cpp

y

$ cat include/a.h 
void f (bool x)
{
    // LCOV_EXCL_START
    if (x)
        throw 1;
    // LCOV_EXCL_STOP
}

y

$ cat tests/test_a.cpp 
#include "a.h"

int main ()
{
    f (false);
    return 0;
}

Pero la línea 5throw 1; se incluye en el informe gcovr, aunque está rodeado de etiquetas de exclusión:

$ g++ -c -O0 -fprofile-arcs -ftest-coverage -fPIC --coverage -I include ./tests/test_a.cpp -o ./build/test_a.o
$ g++ ./build/test_a.o -o ./build/test_a -lgcov
$ ./build/test_a
$ gcovr -r .
------------------------------------------------------------------------------
                           GCC Code Coverage Report
Directory: .
------------------------------------------------------------------------------
File                                       Lines    Exec  Cover   Missing
------------------------------------------------------------------------------
include/a.h                                    4       3    75%   5
tests/test_a.cpp                               3       3   100%   
------------------------------------------------------------------------------
TOTAL                                          7       6    85%
------------------------------------------------------------------------------

Respuestas a la pregunta(0)

Su respuesta a la pregunta