From df64d6ab1557552244328d89f59fb61d3e75860a Mon Sep 17 00:00:00 2001 From: epi Date: Tue, 27 Feb 2024 06:56:40 -0500 Subject: [PATCH] fixed up tests --- Makefile.toml | 4 ++-- src/event_handlers/statistics.rs | 2 +- src/main.rs | 2 +- tests/test_banner.rs | 1 + tests/test_main.rs | 4 +++- tests/test_policies.rs | 12 ++++++------ 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index 549b4c59..303188f1 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -11,7 +11,7 @@ rm ferox-*.state # dependency management [tasks.upgrade-deps] command = "cargo" -args = ["upgrade", "--to-lockfile", "--exclude", "indicatif", "self_update"] +args = ["upgrade", "--exclude", "indicatif, self_update"] [tasks.update] command = "cargo" @@ -28,5 +28,5 @@ cargo clippy --all-targets --all-features -- -D warnings [tasks.test] clear = true script = """ -cargo nextest run --all-features --all-targets --retries 10 +cargo nextest run --all-features --all-targets """ diff --git a/src/event_handlers/statistics.rs b/src/event_handlers/statistics.rs index 580c913f..18ca8275 100644 --- a/src/event_handlers/statistics.rs +++ b/src/event_handlers/statistics.rs @@ -132,7 +132,7 @@ impl StatsHandler { self.bar.finish(); - log::debug!("{:#?}", *self.stats); + log::info!("{:#?}", *self.stats); log::trace!("exit: start"); Ok(()) } diff --git a/src/main.rs b/src/main.rs index 043d7d56..42a87833 100644 --- a/src/main.rs +++ b/src/main.rs @@ -665,7 +665,7 @@ fn main() -> Result<()> { // print the banner to stderr let std_stderr = stderr(); // std::io::stderr let banner = Banner::new(&targets, &config); - if !config.quiet && !config.silent { + if (!config.quiet && !config.silent) || config.parallel != 0 { banner.print_to(std_stderr, config).unwrap(); } } diff --git a/tests/test_banner.rs b/tests/test_banner.rs index e502a74f..96d8a4f0 100644 --- a/tests/test_banner.rs +++ b/tests/test_banner.rs @@ -1146,6 +1146,7 @@ fn banner_prints_parallel() { Command::cargo_bin("feroxbuster") .unwrap() .arg("--stdin") + .arg("--quiet") .arg("--parallel") .arg("4316") .arg("--wordlist") diff --git a/tests/test_main.rs b/tests/test_main.rs index 370d4f6c..17bb3916 100644 --- a/tests/test_main.rs +++ b/tests/test_main.rs @@ -108,10 +108,11 @@ fn main_parallel_spawns_children() -> Result<(), Box> { Command::cargo_bin("feroxbuster") .unwrap() + .env("RUST_LOG", "trace") .arg("--stdin") .arg("--parallel") .arg("2") - .arg("-vvvv") + .arg("--quiet") .arg("--debug-log") .arg(outfile.as_os_str()) .arg("--wordlist") @@ -172,6 +173,7 @@ fn main_parallel_creates_output_directory() -> Result<(), Box