summaryrefslogtreecommitdiffstats
path: root/fuzz/test-fuzzers.sh
blob: 4fdf82b36239af2d10ce3eea1bf5607323e80e8e (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/sh

CURDIR=`pwd`
FUZZDIR=`dirname $0`

cd ${FUZZDIR}

if ! test -x xplist_fuzzer || ! test -x bplist_fuzzer || ! test -x jplist_fuzzer || ! test -x oplist_fuzzer; then
	echo "ERROR: you need to build the fuzzers first."
	cd ${CURDIR}
	exit 1
fi

if ! test -d xplist-input || ! test -d bplist-input || ! test -d jplist-input || ! test -d oplist-input; then
	echo "ERROR: fuzzer corpora directories are not present. Did you run init-fuzzers.sh ?"
	cd ${CURDIR}
	exit 1
fi

echo "### TESTING xplist_fuzzer ###"
if ! ./xplist_fuzzer xplist-input -dict=xplist.dict -max_len=65536 -runs=10000; then
	cd ${CURDIR}
	exit 1
fi

echo "### TESTING bplist_fuzzer ###"
if ! ./bplist_fuzzer bplist-input -dict=bplist.dict -max_len=4096 -runs=10000; then
	cd ${CURDIR}
	exit 1
fi

echo "### TESTING jplist_fuzzer ###"
if ! ./jplist_fuzzer jplist-input -dict=jplist.dict -max_len=65536 -runs=10000; then
	cd ${CURDIR}
	exit 1
fi

echo "### TESTING oplist_fuzzer ###"
if ! ./oplist_fuzzer oplist-input -dict=oplist.dict -max_len=65536 -runs=10000; then
	cd ${CURDIR}
	exit 1
fi

cd ${CURDIR}
exit 0