More stable just test for libfuzzer_stb_image_sugar (#3097)

* aa

* tab to space

* bash syntax is ❤❤❤❤
This commit is contained in:
Dongjia "toka" Zhang 2025-03-20 15:10:14 +01:00 committed by GitHub
parent 2166b45838
commit f73d47dfb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,17 +35,26 @@ run: fuzzer
[macos]
test: fuzzer
#!/bin/bash
success=0
rm -rf libafl_unix_shmem_server || true
(timeout 31s ./{{FUZZER_NAME}} | tee fuzz_stdout.log 2>/dev/null || true) &
(timeout 5s ./{{FUZZER_NAME}} >fuzz_stdout.log 2>/dev/null || true) &
sleep 0.2
timeout 30s ./{{FUZZER_NAME}} >/dev/null 2>/dev/null || true
if grep -qa "corpus: 30" fuzz_stdout.log; then
echo "Fuzzer is working"
timeout 5s ./{{FUZZER_NAME}} >/dev/null 2>/dev/null || true
while read -r line; do
corpus_number=$(echo "$line" | cut -d' ' -f2)
if (( corpus_number > 50 )); then
success=1
fi
done < <(grep -o 'corpus: [0-9]\+' fuzz_stdout.log)
if [ "$success" -eq 1 ]; then
echo "Fuzzer is working!"
exit 0
else
echo "Fuzzer does not generate any testcases or any crashes"
echo "Fuzzer not working!"
exit 1
fi
clean:
#!/bin/bash
rm -f {{FUZZER_NAME}}