nim-eth/tests/fuzzing/fuzz.nims

29 lines
626 B
Plaintext
Raw Normal View History

2019-09-30 13:41:15 +00:00
import ./fuzz_helpers
2019-09-30 13:41:15 +00:00
# TODO: get this some nice cmd line options when confutils works for nimscript
# or if we want to put this in a nim application instead of script
if paramCount() < 3:
echo "Usage: nim fuzz.nims FUZZER TARGET"
echo "Fuzzer options are afl or libFuzzer"
quit 1
let
fuzzer = paramStr(2)
targetPath = paramStr(3)
if not fileExists(targetPath):
echo "Target file does not exist"
quit 1
case fuzzer
of "afl":
2019-09-30 13:41:15 +00:00
runFuzzer(targetPath, afl)
of "libFuzzer":
2019-09-30 13:41:15 +00:00
runFuzzer(targetPath, libFuzzer)
else:
echo "Invalid fuzzer option: ", fuzzer
echo "Fuzzer options are afl or libFuzzer"
2019-09-30 13:41:15 +00:00
quit 1