Domanda

I am trying to generate lcov (version: 1.9) data within the following source directory:

src/
   foo.o
   foo.gcno
   test/inc
         foo.h
   test/src
         foo.cc

Note: that the src/ directory does contain the .gcno file I need, but when I run the lcov command an error occurs during initialization from geninfo:

$LCOV --initial --directory . --base-directory . --gcov-tool $GCOV -c -output-file $initCovFile
geninfo: ERROR: no .bb files found in .!

I have read that --initial should be detecting filetypes .bb, .bbg, or .gcno, but the error above seems to prevent further execution. Next I tried to suppress the errors, so that I might be able to get some output using --ignore-errors option as follows:

geninfo -i . --ignore-errors no .bb files found in . --ignore-errors cannot read .bb!
geninfo: ERROR: cannot read .bb!

I was not able to get past the above error. I do not understand is why geninfo wouldn't just ignore these errors and use the .gcno file in the directory structure above.

How can I get geninfo/lcov to cleanly initialize as I would expect it to?

È stato utile?

Soluzione

From Peter Oberparleiter at IBM:

geninfo: ERROR: no .bb files found in .!

This message is an indication that $GCOV is pointing to a gcov tool from a pre-3.4.0 GCC version which produces .bb files instead of .gcno files. Please use 'gcov --version' to check the version and use a gcov tool that is compatible with the GCC version used to compile your program.

geninfo -i . --ignore-errors no .bb files found in . --ignore-errors cannot read .bb! geninfo: ERROR: cannot read .bb!

geninfo needs one of 'gcov', 'source' or 'graph' as parameter following --ignore-errors. See also 'man geninfo'. In this case though, --ignore-errors won't be able to help get coverage data.

From myself:

As it turns out, this was a product of my linux environment. There are multiple versions of the gcov tool within our environment and my $PATH env variable was pointing to an older version.

So if you are running the more recent versions of these tools (gcov/lcov), you should not run into this problem like I did.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top