Closed cattanimarco closed 2 years ago
Yes, you are right. This behavior would be nice to have.
The reason it doesn't work is because the merge-parser is also a "writer", and --collect-only means that all "writers" are skipped. A solution could be to allow forcing some writers, i.e., the merge-parser in this case.
It actually fails even though I don't use --collect-only during the merge phase, e.g.
kcov --collect-only /tmp/single_n exec
n times and then
kcov --merge /tmp/merged /tmp/single_*
Is this expected too?
Yes, this is expected. I should have explained more: the merge parser relies on a database which is written by a "writer" when kcov runs. This database is not the same as the collection database, which is produced also with collect-only.
The bug is really in the collection step, and in the report / merge step it doesn't matter if collect-only is passed, since it doesn't do any collection anyway.
The merge writer needs special casing to always run, in contrast to the other writers which does not run on collect-only.
Fixed with 4e4c8ad, I believe.
When running kcov--merge with a list of directories created via kcov --collect-only the merge result is invalid (0% coverage)