MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / parse_fuzzer_lcov_data

Function parse_fuzzer_lcov_data

src/feedback/clang_coverage.rs:611–626  ·  view source on GitHub ↗

parse line coverage of fuzzer (not library) from lcov data

(lcov: &str, file: &Path)

Source from the content-addressed store, hash-verified

609
610 /// parse line coverage of fuzzer (not library) from lcov data
611 pub fn parse_fuzzer_lcov_data(lcov: &str, file: &Path) -> Result<Vec<CovLine>> {
612 let mut de = crate::program::serde::Deserializer::from_input(lcov);
613 de.consume_token_until(file.to_str().unwrap())?;
614
615 let mut cov_lines = Vec::new();
616 de.eat_token_until("FNH")?;
617 de.eat_token_until("DA:")?;
618 while de.is_next_token("DA") {
619 de.eat_token("DA:")?;
620 let line: usize = de.parse_number()?;
621 de.eat_token(",")?;
622 let count: usize = de.parse_number()?;
623 cov_lines.push([line, count]);
624 }
625 Ok(cov_lines)
626 }
627
628 /// parse line coverage of library from lcov data
629 pub fn parse_lcov_data(lcov: &str, coverage: &mut CodeCoverage) -> Result<()> {

Callers 1

Calls 6

consume_token_untilMethod · 0.80
eat_token_untilMethod · 0.80
is_next_tokenMethod · 0.80
eat_tokenMethod · 0.80
parse_numberMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected