c testing branch code-coverage lcov

Lcov: no puede recopilar estadísticas de cobertura de sucursales



testing branch (2)

Utilicé el lcov para crear información de cobertura en mi proyecto. Pero solo puedo obtener información de las estadísticas de cobertura de línea y cobertura de función.

lcov version:1.10, gcov version:4.4.5

Los comandos que utilicé son:

lcov -d $OSPL_HOME/src -d $OSPL_OUTER_HOME/src -c -o /work/li/log/lcov-raw.info lcov -r /work/li/log/lcov-raw.info "*.ll" "*.yy" "*.yy.c" yaccpar "TAO161*" "/usr/include/*" "*/testsuite/*" -o /work/li/log/lcov.info

Después de estos dos comandos, obtuve los resultados:

Deleted 23 files Writing data to /work/li/log/lcov.info Summary coverage rate: lines......: 45.4% (65087 of 143496 lines) functions..: 46.1% (5575 of 12102 functions) **branches...: no data found**

Así que no hubo resultados de cobertura de sucursales. ¿Por qué? ¿Entonces qué pasó? ¿Y cómo puede pasar esto? Estoy confundido aquí.

Después del primer comando, recibí muchas advertencias como estas:

geninfo: WARNING: cannot find an entry for ..#..#code#accum.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#at.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#autodef.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#copyof.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#debug.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#define.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#dump.c.gcov in .gcno file,skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#error.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#expand.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#expr.c.gcov in .gcno file,skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#if.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#include.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#io.c.gcov in .gcno file, s kipping file! geninfo: WARNING: cannot find an entry for ..#..#code#is.c.gcov in .gcno file, s kipping file! geninfo: WARNING: cannot find an entry for ..#..#code#line.c.gcov in .gcno file,skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#pragma.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#preprocess.c.gcov in .gcnofile, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#set.c.gcov in .gcno file,skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#sharp.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#symtbl.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#undef.c.gcov in .gcno file, skipping file! geninfo: WARNING: cannot find an entry for ..#..#code#while.c.gcov in .gcno file , skipping file!


La solución dada arriba:

--rc lcov_branch_coverage=1

Usado tanto para lcov como para genhtml, funcionó para mí.


Recibí el correo electrónico de Peter Oberparleiter, el autor de geninfo. Tengo la respuesta de la siguiente manera.

LCOV 1.10 tiene la cobertura de sucursal deshabilitada por defecto. Puede habilitarlo modificando el archivo lcovrc (consulte man lcovrc ) o especificando --rc lcov_branch_coverage=1 cuando ejecute lcov/genhtml .

Si no está utilizando LCOV 1.10 y aún no tiene cobertura de sucursal, es posible que su versión de GCC no proporcione esta información.

( La respuesta anterior fue erróneamente agregada a la pregunta por . )