From cc6f6f41ec77101a6590e825a4a50dbdf5e6dd5c Mon Sep 17 00:00:00 2001 From: Nick Furfaro Date: Thu, 15 Feb 2024 13:22:33 -0700 Subject: [PATCH 1/5] fix: correct order of logs --- src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index 2e99df5..167a9de 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -67,9 +67,9 @@ pub async fn run_cli() -> Result<()> { Some(Subcommand::Mutate) => { let result = handlers::scanner::scan(args.clone(), config.clone_box()); if let Ok(mut result) = result { + let _ = print_scan_results(&mut result.clone(), config.clone_box()); let final_result = handlers::mutator::mutate(args.clone(), config.clone_box(), &mut result); - let _ = print_scan_results(&mut result.clone(), config.clone_box()); final_result } else { Err(result.unwrap_err()) From 4b2c847c8c4143688c760fe5350a56f92d8bb774 Mon Sep 17 00:00:00 2001 From: Nick Furfaro Date: Thu, 15 Feb 2024 13:22:46 -0700 Subject: [PATCH 2/5] chore: cleanup unused code --- src/languages/noir.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/languages/noir.rs b/src/languages/noir.rs index 9d48388..d3331fc 100644 --- a/src/languages/noir.rs +++ b/src/languages/noir.rs @@ -42,14 +42,6 @@ impl LanguageConfig for NoirConfig { "Nargo.toml" } - // fn is_test_failed(&self, stderr: &str) -> bool { - // let stderr = stderr.to_lowercase(); - // stderr.contains("test failed") - // || stderr.contains("failed") - // || stderr.contains("fail") - // || stderr.contains("failed constraint") - // } - fn excluded_dirs(&self) -> Vec<&'static str> { vec!["temp", "target", "test", "tests"] } From 72a5e8564f907763c04abfa89cc976d6f23eedff Mon Sep 17 00:00:00 2001 From: Nick Furfaro Date: Thu, 15 Feb 2024 13:23:02 -0700 Subject: [PATCH 3/5] fix: only print progress bar once --- src/processor.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/processor.rs b/src/processor.rs index fdac2c1..e999494 100644 --- a/src/processor.rs +++ b/src/processor.rs @@ -62,8 +62,6 @@ pub fn process_mutants( .insert(temp_dir.path().to_path_buf()); TEMP_DIRS.lock().unwrap().insert(temp_src_dir.clone()); - dbg!(temp_src_dir.clone()); - let extension = config.ext(); // Check if the temporary directory exists @@ -102,16 +100,13 @@ pub fn process_mutants( match build_status { Some(0) => { - println!("Build was successful"); match test_status { Some(0) => { - println!("Test suite passed"); m.set_status(MutationStatus::Survived); survived.fetch_add(1, Ordering::SeqCst); pending.fetch_sub(1, Ordering::SeqCst); } Some(_) => { - println!("Test suite failed"); destroyed.fetch_add(1, Ordering::SeqCst); pending.fetch_sub(1, Ordering::SeqCst); m.set_status(MutationStatus::Killed); From 2541c74f3540b763eb4794a5371048ceb925f1b7 Mon Sep 17 00:00:00 2001 From: Nick Furfaro Date: Thu, 15 Feb 2024 13:24:49 -0700 Subject: [PATCH 4/5] fixup --- src/cli.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 167a9de..f28bf9d 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -68,9 +68,7 @@ pub async fn run_cli() -> Result<()> { let result = handlers::scanner::scan(args.clone(), config.clone_box()); if let Ok(mut result) = result { let _ = print_scan_results(&mut result.clone(), config.clone_box()); - let final_result = - handlers::mutator::mutate(args.clone(), config.clone_box(), &mut result); - final_result + handlers::mutator::mutate(args.clone(), config.clone_box(), &mut result) } else { Err(result.unwrap_err()) } From ef7ae2038b05005cfbc70108a8cac96ef206f0cd Mon Sep 17 00:00:00 2001 From: Nick Furfaro Date: Thu, 15 Feb 2024 13:24:59 -0700 Subject: [PATCH 5/5] docs: update readme --- README.md | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/README.md b/README.md index bd341e8..d987545 100644 --- a/README.md +++ b/README.md @@ -19,25 +19,10 @@ At a high level, Hunter exposes a CLI with 2 primary commands, scan and mutate. ## Installation -There are 2 ways to install Hunter: via cURL or by building from source. - -### cURL - -1. Download the installation script using cURL: -`curl -LO https://github.com/nfurfaro/hunter/blob/master/scripts/install.sh | bash` - -2. Make the script executable: -`chmod +x install.sh` - -3. run the script: -`./install.sh` - -This will install the binary to `/usr/local/bin`. -You should now be able to run the program by typing `hunter` in your terminal! ### Build from source -Alternatively, you can build Hunter from source. To do so, you'll need to have Rust installed. If you don't have Rust installed, you can install it by following the instructions [here](https://www.rust-lang.org/tools/install). +You can easily build Hunter from source. To do so, you'll need to have Rust installed. If you don't have Rust installed, you can install it by following the instructions [here](https://www.rust-lang.org/tools/install). 1. Clone the repo: `git clone git@github.com:nfurfaro/hunter.git`