Description of the project:
Clang supports source-based coverage that shows which lines of code are covered by the executed tests[1]. It uses llvm-profdata [2] and llvm-cov [3] tools to generate coverage reports. llvm-cov currently generates a single top-level index HTML file. For example, a single top-level directory code coverage report [4] for LLVM repo is published on a coverage bot. Top-level indexing causes rendering scalability issues in large projects, such as Fuchsia [5]. The goal of this project is to generate a hierarchical directory structure in generated coverage html reports to match the directory structure and solve scalability issues. Chromium uses its own post-processing tools to show a per-directory hierarchical structure for coverage results [6]. Similarly, Lcov, which is a graphical front-end Gcov[7], provides a one-level directory structure to display coverage results [8].
Expected result: Implement a support in hierarchical directory structure in generated coverage html reports and show the usage of this feature in LLVM repo code coverage reports.
could someone please explain which step here Code coverage in Chromium
Chromium doing extra as post-processing to show a per-directory hierarchical structure in coverage result?
Thanks for details! So currently there is not directory structure details in PROFDATA? Or it is already there but llvm-cov has not been coded to process it?
@gulfemsavrun Hi, I finished a primitive version with minimum change of code. I think it can satisfy your requirement above. Here is a little output example. It’s a coverage report for one of my homework repository. Forgive me that I don’t have the time to test it on a real large project. If you do need a coverage report for Fuchsia, please let me know.
This patch is aimed to realize the need with minimum efforts and surely has many ways to improve. I am looking forward to get your feedback.
@yhgu2000 Your proposal looks good, and thank you for working on a small prototype to familiarize yourself before submitting the proposal. Please go ahead and start the application process if you are interested in.
Congratulations @yhgu2000, this project got accepted in GSoC 2023.
Welcome to the LLVM community! @petrhosek and I are very excited about this project, and looking forward to working with you!