diff options
Diffstat (limited to 'fuzz/test-fuzzers.sh')
| -rwxr-xr-x | fuzz/test-fuzzers.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fuzz/test-fuzzers.sh b/fuzz/test-fuzzers.sh new file mode 100755 index 0000000..5c758c4 --- /dev/null +++ b/fuzz/test-fuzzers.sh | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | CURDIR=`pwd` | ||
| 4 | FUZZDIR=`dirname $0` | ||
| 5 | |||
| 6 | cd ${FUZZDIR} | ||
| 7 | |||
| 8 | if ! test -x xplist_fuzzer || ! test -x bplist_fuzzer; then | ||
| 9 | echo "ERROR: you need to build the fuzzers first." | ||
| 10 | cd ${CURDIR} | ||
| 11 | exit 1 | ||
| 12 | fi | ||
| 13 | |||
| 14 | if ! test -d xplist-input || ! test -d bplist-input; then | ||
| 15 | echo "ERROR: fuzzer corpora directories are not present. Did you run init-fuzzers.sh ?" | ||
| 16 | cd ${CURDIR} | ||
| 17 | exit 1 | ||
| 18 | fi | ||
| 19 | |||
| 20 | echo "### TESTING xplist_fuzzer ###" | ||
| 21 | if ! ./xplist_fuzzer xplist-input -dict=xplist.dict -runs=10000; then | ||
| 22 | cd ${CURDIR} | ||
| 23 | exit 1 | ||
| 24 | fi | ||
| 25 | |||
| 26 | echo "### TESTING bplist_fuzzer ###" | ||
| 27 | if ! ./bplist_fuzzer bplist-input -dict=bplist.dict -runs=10000; then | ||
| 28 | cd ${CURDIR} | ||
| 29 | exit 1 | ||
| 30 | fi | ||
| 31 | |||
| 32 | cd ${CURDIR} | ||
| 33 | exit 0 | ||
