diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-02-20 11:37:43 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-02-20 12:20:39 +0100 |
| commit | 6911290dbb577fb295e556da6fd7e4f5f7c81a8a (patch) | |
| tree | 96c2f8d5581a7987c8b1f2b95392900a709c0e83 /fuzz/Makefile | |
| parent | f2548fc882ec951d48193ca488c41061cf887971 (diff) | |
| download | vis-6911290dbb577fb295e556da6fd7e4f5f7c81a8a.tar.gz vis-6911290dbb577fb295e556da6fd7e4f5f7c81a8a.tar.xz | |
test/fuzz: add fuzzing infrastructure
For now we use the american fuzzy lop in the future we might
also add libFuzzer support.
Diffstat (limited to 'fuzz/Makefile')
| -rw-r--r-- | fuzz/Makefile | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fuzz/Makefile b/fuzz/Makefile new file mode 100644 index 0000000..66037a2 --- /dev/null +++ b/fuzz/Makefile @@ -0,0 +1,28 @@ +-include ../../config.mk + +ALL = text-fuzzer +CC = afl-gcc +CFLAGS += -I. -I../.. -DBUFFER_SIZE=4 -DBLOCK_SIZE=4 + +test: $(ALL) + +text-fuzzer: text-fuzzer.c fuzzer.h ../../text.c ../../text-util.c ../../text-motions.c ../../text-objects.c ../../text-regex.c + @echo Compiling $@ binary + ${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_EXTRA} ${filter %.c, $^} ${LDFLAGS} -o $@ + +debug: clean + $(MAKE) CFLAGS_EXTRA='${CFLAGS_EXTRA} ${CFLAGS_DEBUG}' + +afl-fuzz-text: text-fuzzer + @mkdir -p "results/$<" + @afl-fuzz -i - -x "dictionaries/$<.dict" -o "results/$<" -- "./$<" || \ + afl-fuzz -i "inputs/$<" -x "dictionaries/$<.dict" -o "results/$<" -- "./$<" + +clean: + @echo cleaning + @rm -f $(ALL) + +distclean: clean + @rm -rf results/ + +.PHONY: clean distclean debug afl-fuzz-text |
