Currently, llvm-cov only supports exclusion of files (based on regular expressions). This adds the possibility to also specify a "whitelist" of files via regex. All files not matching one of the supplied regular expressions will be excluded from coverage reporting.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I tested this locally and it seems to work; however, I would feel better if I had some tests for this (and the ignore-regex filters, too).
As far as I can tell, there would be two steps to adding tests to this:
- Add a test script at (e.g.) llvm/test/tools/llvm-cov/filename_filters.test
- Add some input data for this test script in the form of a "proftext" file at (e.g.) llvm/test/tools/llvm-cov/Inputs/filename_filters.proftext
However, I know neither the syntax of the .test scripts nor the syntax of the proftext format. If I generate some "proftext" file by running llvm-profdata -text …, I can see the file names in the resulting output file, but no paths. Searching for "proftext llvm" or "proftext format" does give me lots of other tests using this format, but no docs on the format itsef. If somebody could point me in the right direction, I'll gladly add some tests.
Please take a look at this patch by Michael Daniels that implements a similar feature:
bfed824b57d14e2ba98ddbaf1a1410cf04a3e279
It includes a test and documentation updates that could be folded into this patch. (The patch was reverted in 8d24d72f7f8b7a111f96510fc6d62b05bfb7dbec due to buildbot failures I didn't have the bandwidth to investigate.)
clang-format not found in user's PATH; not linting file.