From 9182fd93e6b1f56fb66b04077983d4100ff0090f Mon Sep 17 00:00:00 2001 From: ColinSeibel <61788702+ColinSeibel@users.noreply.github.com> Date: Wed, 26 Feb 2025 09:51:09 +0100 Subject: [PATCH] scripts/test_fuzzer.sh: correct working directory (#3024) --- scripts/test_fuzzer.sh | 54 ++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/scripts/test_fuzzer.sh b/scripts/test_fuzzer.sh index fe8d6d7521..bf0670d595 100755 --- a/scripts/test_fuzzer.sh +++ b/scripts/test_fuzzer.sh @@ -43,30 +43,32 @@ do continue fi - cd "$fuzzer" || exit 1 - # Clippy checks - if [ "$1" != "--no-clippy" ]; then - echo "[*] Running clippy for $fuzzer" - cargo clippy || exit 1 - else - echo "[+] Skipping fmt and clippy for $fuzzer (--no-clippy specified)" - fi - - if [ -e ./Makefile.toml ] && grep -qF "skip_core_tasks = true" Makefile.toml; then - echo "[*] Building $fuzzer (running tests is not supported in this context)" - just build || exit 1 - echo "[+] Done building $fuzzer" - elif [ -e ./Makefile.toml ]; then - echo "[*] Testing $fuzzer" - just test || exit 1 - echo "[+] Done testing $fuzzer" - elif [ -e ./Justfile ]; then - echo "[*] Testing $fuzzer" - just test || exit 1 - echo "[+] Done testing $fuzzer" - else - echo "[*] Building $fuzzer" - cargo build || exit 1 - echo "[+] Done building $fuzzer" - fi + ( + cd "$fuzzer" || exit 1 + # Clippy checks + if [ "$1" != "--no-clippy" ]; then + echo "[*] Running clippy for $fuzzer" + cargo clippy || exit 1 + else + echo "[+] Skipping fmt and clippy for $fuzzer (--no-clippy specified)" + fi + + if [ -e ./Makefile.toml ] && grep -qF "skip_core_tasks = true" Makefile.toml; then + echo "[*] Building $fuzzer (running tests is not supported in this context)" + just build || exit 1 + echo "[+] Done building $fuzzer" + elif [ -e ./Makefile.toml ]; then + echo "[*] Testing $fuzzer" + just test || exit 1 + echo "[+] Done testing $fuzzer" + elif [ -e ./Justfile ]; then + echo "[*] Testing $fuzzer" + just test || exit 1 + echo "[+] Done testing $fuzzer" + else + echo "[*] Building $fuzzer" + cargo build || exit 1 + echo "[+] Done building $fuzzer" + fi + ) done