When I try to execute the following lcov command through Plink (I give Plink a text file as an argument containing the following command)
lcov --capture --directory . --output-file coverage.info
it results with
GNU gcov version 1.5 Capturing coverage data from . Scanning . for .da files ... gcov [-b] [-v] [-n] [-l] [-f] [-o OBJDIR] file geninfo: Use of uninitialized value in pattern match (m//) at /home/myUser/lcov/lcov/usr/bin/geninfo line 1874. gcov [-b] [-v] [-n] [-l] [-f] [-o OBJDIR] file geninfo: Use of uninitialized value in pattern match (m//) at /home/myUser/lcov/lcov/usr/bin/geninfo line 3622. geninfo: Use of uninitialized value in pattern match (m//) at /home/myUser/lcov/lcov/usr/bin/geninfo line 3622. geninfo: ERROR: no .da files found in .!
It seems that the geninfo expects for .da files instead of .gcda files. when I execute the same command without Plink (in the same CWD), the lcov runs fine and generates a valid .info file. It also runs fine when I execute it manually thorugh PuTTY.
what might be the reason for this?
The problem was more general. Plink uses different environment variables. The solution was to set manually the correct environment variables. In my case I run perl script so I added in the head of the file:
use Env;
$ENV{PATH} = "correct PATH variable";
a missing environment variable caused the code to get wrong gcov version and therefore .da files were serached instead of .gcda files that belong to newer lcov versions