This is a GSoC 2023 project (discourse link).
llvm-cov currently generates a single top-level index HTML file, which causes rendering scalability issues in large projects. This patch adds support for hierarchical directory structure into the HTML reports to solve scalability issues by introducing the following changes:
- Added a new command line option --show-directory-coverage for llvm-cov show. It works both for --format=html and --format=text.
- Two new classes: CoveragePrinterHTMLDirectory and CoveragePrinterTextDirectory was added to support the new option.
- A tool class DirectoryCoverageReport was added to support the two classes above.
- Updated the document.
- Added a new regression test for --show-directory-coverage.
Here is a coverage report preview of LLVM:
Some llvm-cov tests like llvm-cov::branch-c-general.test are failing in the presubmit tests. The reason is that you are changing the default behavior and some tests rely on that behavior. As a transitioning step, I would suggest adding a new option like showDirectoryCoverage into https://github.com/llvm/llvm-project/blob/main/llvm/tools/llvm-cov/CoverageViewOptions.h#L30, and using the associated class based on that option like: