0

I'm testing a project and generating a coverage report to it. To test faster I distribute the tests to multiple machines, and to run the tests each machine runs multiple VMs running the same source code. After running the tests, machine by machine, sequentially I download the .gcda files from each VM to my local machine, where I have the source code & .gcno files (to the same folder where the .gcno files are), and capture the coverage data using LCOV, then merge all tracefiles into one report.

This takes a lot of time, so I'm trying to process each machine in parallel. i.e, create a new directory for each machine, copy all .gcno files there, place .gcda files from VM1, capture using LCOV, remove .gcda files and move on to VM2 and so on, in parallel to other machines.

however this doesn't seem to work in parallel, I get errors like:

geninfo: WARNING: cannot find an entry for <filename>.cpp##40992095d0c9bb48bed0bae1c95c1186.gcov in .gcno file, skipping file!

geninfo: ERROR: cannot read <filename>.h##daeff1584c7450a8dd7997e08ab6424c.gcov!

this is the lcov command I'm using for each machine:

lcov --gcov-tool <path>/build/bin/../gcc-7.3.0/bin/gcov --directory <.gcno/.gcda dir> --base-directory <src dir> --quiet --capture --no-external --test-name <name> --output-file /tmp/lcov_<name>

Does lcov use the same .gcno files even though I copied them to a new directory with the .gcda files? Is there anyway to run lcov in parallel in this environment? Thank you!

edit: It works in parallel if I duplicate the source code. seems like lcov is creating temp files in the source code directory, and when running in parallel all threads are trying to access the same temp files. Is there any way to use the same source code instead of duplicating for each thread?

Wolf
  • 77
  • 8
  • seems like gcov is creating temporary files inside the source code directory (--base-directory), and then fails in parallel runs because the names are the same. – Wolf Oct 25 '22 at 10:46

0 Answers0