Skip to content

Commit

Permalink
Documentation for main methods
Browse files Browse the repository at this point in the history
  • Loading branch information
adpaco-aws committed Sep 20, 2024
1 parent 812231e commit 745a55f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/kani-cov/src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ use crate::coverage::{
use crate::summary::line_coverage_results;
use crate::{args::ReportArgs, coverage::CombinedCoverageResults};

/// Executes the `report` subcommand.
///
/// First, it loads the coverage metadata and results from the files passed as
/// arguments. Then, for each file referenced in the metadata, it computes its
/// associated coverage information on a per-function basis, producing a
/// human-readable report for each one of the files.
pub fn report_main(args: &ReportArgs) -> Result<()> {
let mapfile = File::open(&args.mapfile)?;
let reader = BufReader::new(mapfile);
Expand Down Expand Up @@ -203,6 +209,7 @@ pub fn print_coverage_results(
/// * `offset` represents the offset in which the marker must be inserted, and
/// * `type` represents whether it is an opening (`true`) or closing (`false`)
/// escape.
///
/// The specific escape to be used are determined by the report format.
fn insert_escapes(str: &str, markers: Vec<(usize, bool)>, format: &ReportFormat) -> String {
// Determine the escape strings based on the format
Expand Down
6 changes: 6 additions & 0 deletions tools/kani-cov/src/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ use crate::{
},
};

/// Executes the `summary` subcommand.
///
/// First, it loads the coverage metadata and results from the files passed as
/// arguments. Then, for each file referenced in the metadata, it computes its
/// associated coverage information on a per-function basis, producing coverage
/// metrics for each one of the files.
pub fn summary_main(args: &SummaryArgs) -> Result<()> {
let mapfile = File::open(&args.mapfile)?;
let reader = BufReader::new(mapfile);
Expand Down

0 comments on commit 745a55f

Please sign in to comment.