lundi 9 octobre 2017

LCOV "cannot find an entry" in .gcno file, extra forward slashes in path name

Searched for similar topics, found this but this isn't an issue with branch coverage reporting.

We are using LCOV to generate code coverage for our project, and it seems to be working fairly well. However, I noticed a small subset of our files were not included in the generate .info tracefile.

Looking through the LCOV output, I noticed the following error messages: (Note that file names were changed due to some potential IP issues)

Capturing coverage data from ../buildout/main
Found gcov version: 4.8.3
Scanning ../buildout/main for .gcda files ...
Found 492 data files in ../buildout/main
Processing node/sim/objects/app_code/file1.gcda
Processing node/sim/objects/app_code/file2.gcda
Processing node/sim/objects/app_code/file3.gcda
geninfo: WARNING: cannot find an entry for #home#user#project#src#app_code#backend#etc#file3.c.gcov in .gcno file, skipping file!
...
...

Comparing the passing .gcno files (for example, file2.gcno) I discovered that the failing file3.gcno included extra forward slashes in the path.

From file2.gcno (passing):

/home/user/project/src/app_code/backend/other/file2.c

from file3.gcno (failing):

/home/user/project/src/app_code/backend////////////etc/file3.c

Somewhere in the .gcno file generation it added too many forward slashes. Has anyone seen this before, or have an idea on what I might be able to do to fix or work around this? Any help or insight would be greatly appreciated.

Commands used:

gcc flags = -lgcov -fprofile-arcs -ftest-coverage -fprofile-dir=coverage  -fno-inline -fno-inline-small-functions -fno-default-inline

lcov --base-directory ../buildout/main --directory ../buildout/main -c -o ../code_coverage/out.info --test-name "Test Coverage"

Aucun commentaire:

Enregistrer un commentaire