This is an archive of the discontinued LLVM Phabricator instance.

[llvm-cov] don't include all source files when provided source files are filtered out
ClosedPublic

Authored by zequanwu on Oct 13 2020, 6:55 PM.

Details

Summary

When all provided source files are filtered out either due to --ignore-filename-regex or not part of binary, don't generate coverage reults for all source files. Because if users want to generate coverage results for all source files, they don't even need to provid selected source files or --ignore-filename-regex.

Diff Detail

Event Timeline

zequanwu created this revision.Oct 13 2020, 6:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2020, 6:55 PM
zequanwu requested review of this revision.Oct 13 2020, 6:55 PM
vsk added a comment.Oct 14 2020, 9:16 AM

Looks reasonable, but please add a test.

zequanwu updated this revision to Diff 298270.Oct 14 2020, 6:01 PM
  • Add a test case
  • Fix broken test cases caused by -path-equivalence= not working correctly with . and .. in paths.
vsk accepted this revision.Oct 15 2020, 11:00 AM

Thanks, lgtm!

This revision is now accepted and ready to land.Oct 15 2020, 11:00 AM
This revision was landed with ongoing or failed builds.Oct 15 2020, 6:11 PM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Oct 15 2020, 8:04 PM

Looks like this breaks tests on windows: http://45.33.8.238/win/25951/step_11.txt

jmorse added a subscriber: jmorse.Oct 16 2020, 5:48 AM

I've reverted this and the follow-up patch in rG0a7f41739fd994a50 as it continued to fail tools/llvm-cov/warnings.h on Windows-based platforms.

zequanwu reopened this revision.Oct 23 2020, 6:46 PM
This revision is now accepted and ready to land.Oct 23 2020, 6:46 PM
zequanwu updated this revision to Diff 300449.Oct 23 2020, 7:32 PM

Fix test cases which failed on Windows.

This revision was landed with ongoing or failed builds.Oct 23 2020, 7:32 PM
This revision was automatically updated to reflect the committed changes.
Dor1s added a subscriber: Dor1s.Nov 6 2020, 8:46 AM
Dor1s added inline comments.
llvm/tools/llvm-cov/CodeCoverage.cpp
414

Why was this line added? Looks like it broke some big deployments: https://github.com/google/oss-fuzz/issues/4608

zequanwu added inline comments.Nov 6 2020, 2:54 PM
Dor1s added inline comments.Nov 9 2020, 2:18 PM
llvm/tools/llvm-cov/CodeCoverage.cpp
414

Thank you for the quick response!