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

Function parse_cov_from_log

src/execution/mod.rs:977–990  ·  view source on GitHub ↗
(log_file: &Path)

Source from the content-addressed store, hash-verified

975}
976
977fn parse_cov_from_log(log_file: &Path) -> eyre::Result<Option<usize>> {
978 let bytes = std::fs::read(log_file)?;
979 let msg = String::from_utf8_lossy(&bytes);
980 let last_line = msg.lines().last().ok_or_else(|| eyre::eyre!("{msg}"))?;
981 let re = Regex::new(r"cov: (\d+)")?;
982 if let Some(captures) = re.captures(last_line) {
983 if let Some(cov) = captures.get(1) {
984 let cov = cov.as_str();
985 let cov: usize = cov.parse()?;
986 return Ok(Some(cov));
987 }
988 }
989 Ok(None)
990}
991
992pub fn max_cpu_count() -> usize {
993 let max_cores = get_config().max_cores;

Callers 1

execute_fuzzerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected