@zeromake/llvm-coverage-viewer
v1.0.10
Published
Convert llvm coverage report json to single html file
Downloads
9
Readme
llvm-coverage-viewer
I thought my tests covered that!
Prerequisites
Prerequisites For Development
- [clang] - https://clang.llvm.org/
- [llvm-profdata] - https://llvm.org/docs/CommandGuide/llvm-profdata.html
- [llvm-cov] - https://llvm.org/docs/CommandGuide/llvm-cov.html
Features
- outputs only one html file
- syntax highlighting
- highlights missed code coverage
- filter files by name
- collapsible folder tree ui
- uses react and material-ui
Limitations
- json report must be lesser than 256MB
Install
npm install -g llvm-coverage-viewer
Usage
After you've successfully exported your llvm coverage report as JSON, the following command will generate a beautiful report.
llvm-coverage-viewer -j json_report.json -o html_report.html
How do I export llvm code coverage to JSON?
Use the llvm-cov export
command.
I created an example C++ project to generate and export llvm code coverage to JSON document for testing and development.
llvm-cov report "<executable>" -instr-profile="all.profdata"
Development
The following commands should start the development server so you can start coding. If you want to load a different llvm code coverage report while developing, you can change it by modifying the hardcoded path here
# build example c++ project
cd test/fixtures/cpp_project
./build_report_fixture.sh
npm install
npm start