pub fn summarize_human<W: Write>(
        &self,
        summary_writer: &mut W,
        summarize_function_coverage: bool,
    ) -> io::Result<(u64, u64)> {
        let mut all_total = 0;
        let mut all_covered = 0;

        writeln!(
            summary_writer,
            "Module {}::{}",
            self.module_name.address(),
            self.module_name.name()
        )?;

        for (fn_name, fn_summary) in self.function_summaries.iter() {
            all_total += fn_summary.total;
            all_covered += fn_summary.covered;

            if summarize_function_coverage {
                let native = if fn_summary.fn_is_native {
                    "native "
                } else {
                    ""
                };
                writeln!(summary_writer, "\t{}fun {}", native, fn_name)?;
                writeln!(summary_writer, "\t\ttotal: {}", fn_summary.total)?;
                writeln!(summary_writer, "\t\tcovered: {}", fn_summary.covered)?;
                writeln!(
                    summary_writer,
                    "\t\t% coverage: {:.2}",
                    fn_summary.percent_coverage()
                )?;
            }
        }

        let covered_percentage = (all_covered as f64) / (all_total as f64) * 100f64;
        writeln!(
            summary_writer,
            ">>> % Module coverage: {:.2}",
            covered_percentage
        )?;
        Ok((all_total, all_covered))
    }
/// Summarizes the modules coverage, and returns the total module coverage in a human-readable
/// format.
Summarizes the modules coverage, and returns the total module coverage in a human-readable
format.
Summarizes the modules coverage and returns the total module coverage in a human - readable format .
pub fn summarize_human<W: Write>(
        &self,
        summary_writer: &mut W,
        summarize_function_coverage: bool,
    ) -> io::Result<(u64, u64)> {
        let mut all_total = 0;
        let mut all_covered = 0;
        writeln!(
            summary_writer,
            "Module {}::{}",
            self.module_name.address(),
            self.module_name.name()
        )?;
        for (fn_name, fn_summary) in self.function_summaries.iter() {
            all_total += fn_summary.total;
            all_covered += fn_summary.covered;
            if summarize_function_coverage {
                let native = if fn_summary.fn_is_native {
                    "native "
                } else {
                    ""
                };
                writeln!(summary_writer, "\t{}fun {}", native, fn_name)?;
                writeln!(summary_writer, "\t\ttotal: {}", fn_summary.total)?;
                writeln!(summary_writer, "\t\tcovered: {}", fn_summary.covered)?;
                writeln!(
                    summary_writer,
                    "\t\t% coverage: {:.2}",
                    fn_summary.percent_coverage()
                )?;
            }
        }
        let covered_percentage = (all_covered as f64) / (all_total as f64) * 100f64;
        writeln!(
            summary_writer,
            ">>> % Module coverage: {:.2}",
            covered_percentage
        )?;
        Ok((all_total, all_covered))
    }
pub fn summarize_human < W : Write > ( & self , summary_writer : & mut W , summarize_function_coverage : bool , ) -> io :: Result < ( u64 , u64 ) > { let mut all_total = 0 ; let mut all_covered = 0 ; writeln ! ( summary_writer " " self module_name address ( ) self module_name name ( ) ) ? ; for ( fn_name , fn_summary ) in self . function_summaries . iter ( ) { all_total += fn_summary . total ; all_covered += fn_summary . covered ; if summarize_function_coverage { let native = if fn_summary . fn_is_native { " " } else { " " } ; writeln ! ( summary_writer " \t " native fn_name ) ? ; writeln ! ( summary_writer " \t \t " fn_summary total ) ? ; writeln ! ( summary_writer " \t \t " fn_summary covered ) ? ; writeln ! ( summary_writer " \t \t " fn_summary percent_coverage ( ) ) ? ; } } let covered_percentage = ( all_covered as f64 ) / ( all_total as f64 ) * 100f64 ; writeln ! ( summary_writer " " covered_percentage ) ? ; Ok ( ( all_total , all_covered ) ) }
Summarizes the modules coverage, and returns the total module coverage in a human-readable
format.
Summarizes the modules coverage and returns the total module coverage in a human - readable format .
&self
summary_writer
&mut W
summarize_function_coverage
bool