llvm-cov-json-rs
This library can parse llvm-cov
reports exported as JSON.
Such JSON exports are typically created by using the following command:
# Dump JSON export to stdout.
For more details on LLVM's source code-based coverage, see here.
For Rust projects, they can be created using cargo-llvm-cov using the following command:
# Dump JSON export to stdout.
Example
use fs;
use ;
let json_data = read_to_string.unwrap
let report: CoverageReport = from_str.unwrap;
/// Get the total count of branches from the summary.
let summary_branch_count = report.data.summary.branches.count;
println!;