summaryrefslogtreecommitdiff
path: root/maint/fuzz_it_all.sh
blob: 2bf8e69eeaa916ef3ffc7932e734649eca490003 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash

set -e

trap 'kill $(jobs -p)' EXIT

for d in ./crates/*/fuzz; do
    pushd "$(dirname "$d")"
    for fuzzer in $(cargo +nightly fuzz list); do
	echo "$fuzzer"
	cargo +nightly fuzz build "$fuzzer"
    done
    popd
done


#JOBS=4

while true; do
    for d in ./crates/*/fuzz; do
	pushd "$(dirname "$d")"
	for fuzzer in $(cargo +nightly fuzz list); do
	    set +e
	    timeout 20m cargo +nightly fuzz run "$fuzzer"
	    status="$?"
	    set -e
	    case "$status" in
		0)
  		    # Successful exit?
		    ;;
		124)
		    # This is a timeout
		    ;;
		*)
		    exit 1
		    ;;
	    esac
	done
	popd
    done
done


# wait -n