make: add afl_tmin target

minimize all failing cases to help debugging
This commit is contained in:
Noah Hellman 2023-03-12 19:04:04 +01:00
parent 0d884a65d5
commit bd831058f7

View file

@ -77,7 +77,8 @@ afl_quick:
afl_crash: afl_crash:
set +e; \ set +e; \
for f in $$(find tests/afl/out -path '*/${AFL_TARGET_CRASH}/id*'); do \ failures="$$(find . -path './tmin/*') $$(find tests/afl/out -path '*/${AFL_TARGET_CRASH}/id*')"; \
for f in $$failures; do \
echo $$f; \ echo $$f; \
out=$$(cat $$f | (cd tests/afl && RUST_BACKTRACE=1 cargo run ${AFL_TARGET} 2>&1)); \ out=$$(cat $$f | (cd tests/afl && RUST_BACKTRACE=1 cargo run ${AFL_TARGET} 2>&1)); \
if [ $$? -ne 0 ]; then \ if [ $$? -ne 0 ]; then \
@ -88,6 +89,13 @@ afl_crash:
fi; \ fi; \
done done
afl_tmin:
rm -rf tmin
mkdir tmin
for f in $$(find tests/afl/out -path '*/${AFL_TARGET_CRASH}/id*'); do \
cargo afl tmin -i $$f -o tmin/$$(basename $$f) tests/afl/target/release/${AFL_TARGET}; \
done
clean: clean:
cargo clean cargo clean
git submodule deinit -f --all git submodule deinit -f --all