Skip to content

Commit

Permalink
Merge pull request #39 from samparsky/master
Browse files Browse the repository at this point in the history
Move println statement out of lib.rs
  • Loading branch information
chandrakananandi authored Jan 11, 2024
2 parents 862cd0f + 77ec409 commit a97670e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ pub fn run_mutate(
}

let t = start.elapsed().as_secs_f64();
println!(
"Generated {} mutants in {:.2} seconds",
total_num_mutants, t
);
log::info!("Generated {} mutants in {}", total_num_mutants, t);
Ok(results)
}
Expand Down
20 changes: 17 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
params.solc_base_path = basepath;
params.solc_remappings = remapping;
}
run_mutate(mutate_params)?;
execute_mutation(mutate_params)?;
} else {
log::debug!("Running CLI MutateParams: {:#?}", &params);
// # Path Resolution for CLI Provided Parameters
Expand Down Expand Up @@ -469,8 +469,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
params.solc_include_path = solc_include_path;
params.solc_base_path = solc_basepath;
params.solc_remappings = solc_remapping;

run_mutate(vec![*params])?;
execute_mutation(vec![*params])?;
}
}
Command::Summary(params) => {
Expand All @@ -480,6 +480,20 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}


/// Execute mutation
fn execute_mutation(params: Vec<MutateParams>) -> Result<(), Box<dyn std::error::Error>> {
let start = std::time::Instant::now();
let result = run_mutate(params)?;
let t = start.elapsed().as_secs_f64();
let total_num_mutants = result.values().flat_map(|x|x).count();
println!(
"Generated {} mutants in {:.2} seconds",
total_num_mutants, t
);

Ok(())
}
/// Resolve a filename with respect to the directory containing the config file
fn resolve_config_file_path(
path: &String,
Expand Down

0 comments on commit a97670e

Please sign in to comment.