From 27db5054d8bed3b52641369efc54c82759ffa3be Mon Sep 17 00:00:00 2001 From: Louis Merlin Date: Thu, 5 Dec 2024 16:06:51 +0100 Subject: [PATCH] Fix tests and fmt --- src/bin/cargo-ziggy/minimize.rs | 5 ++++- tests/url_fuzz.rs | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/bin/cargo-ziggy/minimize.rs b/src/bin/cargo-ziggy/minimize.rs index 4bf2321..c428bc6 100644 --- a/src/bin/cargo-ziggy/minimize.rs +++ b/src/bin/cargo-ziggy/minimize.rs @@ -21,7 +21,10 @@ impl Minimize { find_target(&self.target).context("⚠️ couldn't find target when minimizing")?; if fs::read_dir(self.output_corpus()).is_ok() { - return Err(anyhow!("Directory {} exists, please move it before running minimization", self.output_corpus())); + return Err(anyhow!( + "Directory {} exists, please move it before running minimization", + self.output_corpus() + )); } let entries = fs::read_dir(self.input_corpus())?; diff --git a/tests/url_fuzz.rs b/tests/url_fuzz.rs index f8248fa..d7983e6 100644 --- a/tests/url_fuzz.rs +++ b/tests/url_fuzz.rs @@ -1,5 +1,5 @@ use std::{ - env, + env, fs, path::PathBuf, process, thread, time::{Duration, SystemTime, UNIX_EPOCH}, @@ -120,6 +120,8 @@ fn integration() { .join("minimization_afl.log") .is_file()); + fs::remove_dir_all(temp_dir_path.join("url-fuzz").join("corpus_minimized")).unwrap(); + // cargo ziggy minimize -e honggfuzz let minimization = process::Command::new(&cargo_ziggy) .arg("ziggy") @@ -137,7 +139,6 @@ fn integration() { .join("minimization_honggfuzz.log") .is_file()); - /* Removed until https://github.com/mozilla/grcov/issues/1240 has a fix // cargo ziggy cover let coverage = process::Command::new(&cargo_ziggy) .arg("ziggy") @@ -153,7 +154,6 @@ fn integration() { .join("coverage") .join("index.html") .is_file()); - */ // cargo ziggy plot let plot = process::Command::new(&cargo_ziggy)