From 86275c27d2931afe434b3f68ef916323e0e5b0b6 Mon Sep 17 00:00:00 2001 From: lukacan Date: Tue, 9 Jan 2024 16:20:12 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20remove=20cur=5Fdir=20as=20I=20th?= =?UTF-8?q?ink=20it=20is=20unnecessary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/commander.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/crates/client/src/commander.rs b/crates/client/src/commander.rs index 924364dc..9ceb397b 100644 --- a/crates/client/src/commander.rs +++ b/crates/client/src/commander.rs @@ -22,7 +22,6 @@ use tokio::{ signal, }; -pub const TESTS_WORKSPACE: &str = "trdelnik-tests"; pub const PROGRAM_CLIENT_DIRECTORY: &str = ".program_client"; pub const CARGO_TARGET_DIR_DEFAULT: &str = "trdelnik-tests/fuzz_tests/fuzzing/hfuzz_target"; pub const HFUZZ_WORKSPACE_DEFAULT: &str = "trdelnik-tests/fuzz_tests/fuzzing/hfuzz_workspace"; @@ -254,12 +253,7 @@ impl Commander { /// Runs fuzzer on the given target. #[throws] pub async fn run_fuzzer_debug(&self, target: String, crash_file_path: String) { - let cur_dir = Path::new(&self.root.to_string()).join(TESTS_WORKSPACE); - let crash_file = std::env::current_dir()?.join(crash_file_path); - - if !cur_dir.try_exists()? { - throw!(Error::NotInitialized); - } + let crash_file = std::path::Path::new(&self.root as &str).join(crash_file_path); if !crash_file.try_exists()? { println!("The crash file {:?} not found!", crash_file); @@ -271,7 +265,6 @@ impl Commander { // using exec rather than spawn and replacing current process to avoid unflushed terminal output after ctrl+c signal std::process::Command::new("cargo") - .current_dir(cur_dir) .env("CARGO_TARGET_DIR", cargo_target_dir) .arg("hfuzz") .arg("run-debug")