summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-06-27 23:03:53 +0200
committerGitHub <noreply@github.com>2017-06-27 23:03:53 +0200
commit153116f7fd955bbcfee5fe80996a4619c7a343c3 (patch)
tree8bbe02cdfdd4720cce9c69f2f552775338f66038 /Makefile
parent00291fd1811eba348f649f74f4c727625f0be945 (diff)
parenta2f1f76dc38a34d0e3d97f75d1fee527931b6e8a (diff)
Merge pull request #209 from philipturnbull/libFuzzer
Add libFuzzer harness for oss-fuzz
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 987ed2b..c10c035 100644
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,7 @@ BENCHFILE=$(BENCHDIR)/benchinput.md
ALLTESTS=alltests.md
NUMRUNS?=10
CMARK=$(BUILDDIR)/src/cmark
+CMARK_FUZZ=$(BUILDDIR)/src/cmark-fuzz
PROG?=$(CMARK)
VERSION?=$(SPECVERSION)
RELEASE?=CommonMark-$(VERSION)
@@ -77,10 +78,17 @@ afl:
$(AFL_PATH)/afl-fuzz \
-i test/afl_test_cases \
-o test/afl_results \
- -x test/afl_dictionary \
+ -x test/fuzzing_dictionary \
-t 100 \
$(CMARK) $(CMARK_OPTS)
+libFuzzer:
+ @[ -n "$(LIB_FUZZER_PATH)" ] || { echo '$$LIB_FUZZER_PATH not set'; false; }
+ mkdir -p $(BUILDDIR)
+ cd $(BUILDDIR) && cmake -DCMAKE_BUILD_TYPE=Asan -DCMARK_LIB_FUZZER=ON -DCMAKE_LIB_FUZZER_PATH=$(LIB_FUZZER_PATH) ..
+ $(MAKE) -j2 -C $(BUILDDIR) cmark-fuzz
+ test/run-cmark-fuzz $(CMARK_FUZZ)
+
clang-check: all
${CLANG_CHECK} -p build -analyze src/*.c