Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
8e2bea4f
Commit
8e2bea4f
authored
Apr 10, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add script to automate AFL fuzzing.
parent
84a5fcbd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
afl-fuzz.sh
c++/afl-fuzz.sh
+72
-0
No files found.
c++/afl-fuzz.sh
0 → 100755
View file @
8e2bea4f
#! /bin/bash
set
-euo
pipefail
echo
"Choose test case:"
echo
"1) TestAllTypes parsing"
echo
"2) TestLists parsing"
echo
"3) Canonicalization"
read
-p
"choice: "
-n
1 TESTCASE
echo
case
"
$TESTCASE
"
in
1
)
TESTDATA
=
binary
FLAGS
=
TESTNAME
=
default
;;
2
)
TESTDATA
=
lists.binary
FLAGS
=
--lists
TESTNAME
=
lists
;;
3
)
TESTDATA
=
binary
FLAGS
=
--canonicalize
TESTNAME
=
canonicalize
;;
*
)
echo
"Invalid choice:
$TESTCASE
"
>
&2
exit
1
esac
echo
"Choose compiler:"
echo
"1) GCC"
echo
"2) Clang"
read
-p
"choice: "
-n
1 TESTCASE
echo
case
"
$TESTCASE
"
in
1
)
export
CXX
=
afl-g++
;;
2
)
export
CXX
=
afl-clang++
;;
*
)
echo
"Invalid choice:
$TESTCASE
"
>
&2
exit
1
esac
if
[
-e
Makefile
]
;
then
if
!
grep
-q
'^CXX *= *'
"
$CXX
"
Makefile
;
then
# Wrong complier used.
make distclean
$(
dirname
$0
)
/configure
--disable-shared
fi
else
$(
dirname
$0
)
/configure
--disable-shared
fi
make
-j
$(
nproc
)
make
-j
$(
nproc
)
capnp-afl-testcase
NOW
=
$(
date
+%Y-%m-%d.%H-%M-%S
)
.
$TESTNAME
.
$CXX
mkdir
afl.
$NOW
.inputs afl.
$NOW
.findings
cp
$(
dirname
$0
)
/src/capnp/testdata/
$TESTDATA
afl.
$NOW
.inputs
afl-fuzz
-i
afl.
$NOW
.inputs
-o
afl.
$NOW
.findings
--
./capnp-afl-testcase
$FLAGS
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment