0

I'm are trying to setup lcov on a local Windows computer using cygwin and the bash shell. I installed the newest version of lcov downloaded from here: lcov at sourceforge.

When I call a specific gcda file, then I get an output. The call is: lcov -c -d FileName.gcda -o outputfile.info

As far as I read usually lcov shall be able to iterate over all gcda files in a folder. My call for rotating over all gcda files is:

lcov -c -d . -o outputfile.info

With the above code I get the following output:

Capturing coverage data from .
Found gcov version 6.4.0
Scanning . for .gcda files ...
geninfo: WARNING: no .gcda files found in . - skipping!
Finished .info-file creation

Here a screenshot: lcov failure As can be seen, there is a CanAdapter.gcda and CanAdapter.gcno, but with the configuration above geninfo produces a failure.

When I try to make a call like this:

lcove -c -d *.gcda -o outputfile.info

I get the following answer:

lcov: Extra parameter found: 'FileName2.gcda'
Use lcov --help to get usage information

I read the help, and it doesn't help as much as I need.

MarksSO
  • 63
  • 1
  • 12

3 Answers3

0

According to the lcov manpage -d is used to specify a directory to use.

So try

-d .

arved
  • 4,401
  • 4
  • 30
  • 53
  • Thank you for your answer. As you can see, I add to my posting a screenshot for better understanding. As you can see, there ist the "-d ." parameter in my call of lcov. – MarksSO Mar 13 '19 at 17:03
  • I am sorry, I used lcov exactly like this and it works. On Linux I would now run strace to find out, why it doesn't find the file, but I am not sure about Windows – arved Mar 13 '19 at 17:16
0

I run lcov on Linux like this :

lcov --c --directory . --output-file main.info

This works fine with my setup.Try running pwd when you open shell to see if you are currently in the same directory or not.

VVish
  • 251
  • 4
  • 11
0

I found the answer to my problem.

On windows machine there are two possibilities to run lcov.

  1. In the cygwin folder there is a batch script calling "Cygwin.bat". Run this script. When the scripts opens type the following line:

lcov -c -d /cygdrive/c/path where the gcda files are located -o /cygdrive/c/path where the output folder is located/lcov.info

The same is to do with genhtml to create the html file.

  1. You can open the windows cmd.exe. After this you need to add the following line:

sh -c -l "lcov -c -d /cygdrive/c/path where the gcda files are located -o /cygdrive/c/path where the output folder is located/lcov.info"

It is important to write

sh -c -l

and the lcov command in

" "

otherwise lcov and genhtml wont work.

MarksSO
  • 63
  • 1
  • 12