lcov icon indicating copy to clipboard operation
lcov copied to clipboard

geninfo: ERROR: unable to open some/file: No such file or directory while using --exclude "some/file"

Open GitMensch opened this issue 6 months ago • 1 comments

lcov 2 errors if it cannot process a source file from the coverage, which is ok (note: there was no error with lcov 1).

lcov does provide an option --exclude, but sadly this is not checked before. Can this please be changed (so the file matching that pattern are not opened at all)?

GitMensch avatar May 27 '25 16:05 GitMensch

Do you have a small testcase which illustrates the issue?

A quick perusal of the code suggests that this is already the case (try to resolve the path - say, by applying substitutions and the 'resolve' callback, if any - then skip the resulting file if the resolved path matches an exclude pattern). There may be some details that I failed to notice, however - so god to look at a testcase.

As you note: newer versions of lcov are deliberately more paranoid than older versions. Any tool used for verification/validation needs to warn about anything fishy that it thinks it finds. The result of not doing so can be very, very expensive.

henry2cox avatar May 27 '25 17:05 henry2cox

No updates in 2 months - so closing this one now.

If there is still a problem, please feel free to either reopen this issue or file a new one. Please include a testcase which exhibits the problem. Thanks

henry2cox avatar Aug 06 '25 19:08 henry2cox