[fuzzing] Add build system
This commit is contained in:
parent
9c9ad214af
commit
19300183a6
|
@ -440,6 +440,7 @@ src/hb-ucdn/Makefile
|
|||
util/Makefile
|
||||
test/Makefile
|
||||
test/api/Makefile
|
||||
test/fuzzing/Makefile
|
||||
test/shaping/Makefile
|
||||
docs/Makefile
|
||||
docs/version.xml
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = api shaping
|
||||
SUBDIRS = api shaping fuzzing
|
||||
|
||||
# Convenience targets:
|
||||
lib:
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
# Process this file with automake to produce Makefile.in
|
||||
|
||||
NULL =
|
||||
EXTRA_DIST =
|
||||
CLEANFILES =
|
||||
DISTCLEANFILES =
|
||||
MAINTAINERCLEANFILES =
|
||||
|
||||
# Convenience targets:
|
||||
lib:
|
||||
@$(MAKE) $(AM_MAKEFLAGS) -C $(top_builddir)/src lib
|
||||
|
||||
EXTRA_DIST += \
|
||||
README \
|
||||
$(NULL)
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
hb-fuzzer \
|
||||
$(NULL)
|
||||
check_PROGRAMS = $(noinst_PROGRAMS)
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-DHB_DISABLE_DEPRECATED \
|
||||
-I$(top_srcdir)/src/ \
|
||||
-I$(top_builddir)/src/ \
|
||||
$(NULL)
|
||||
LDADD = \
|
||||
$(top_builddir)/src/libharfbuzz.la \
|
||||
$(NULL)
|
||||
|
||||
hb_fuzzer_SOURCES = \
|
||||
hb-fuzzer.cc \
|
||||
$(NULL)
|
||||
hb_fuzzer_LDADD = \
|
||||
$(LDADD) \
|
||||
$(NULL)
|
||||
hb_fuzzer_CPPFLAGS = \
|
||||
$(AM_CPPFLAGS) \
|
||||
-DMAIN \
|
||||
-DHB_MAX_NESTING_LEVEL=3 \
|
||||
-DHB_SANITIZE_MAX_EDITS=3 \
|
||||
$(NULL)
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
|
@ -5,6 +5,8 @@ harfbuzz/test/fuzzing/hb-fuzzer.cc with:
|
|||
- With -fsanitize-coverage=edge[,8bit-counters,trace-cmp]
|
||||
- With various defines that limit worst case exponential behavior:
|
||||
* -DHB_MAX_NESTING_LEVEL=3
|
||||
* -DHB_SANITIZE_MAX_EDITS=3
|
||||
* See Makefile.am for full list of flags
|
||||
- link against libFuzzer
|
||||
|
||||
To run the fuzzer one needs to first obtain a test corpus as a directory
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <stddef.h>
|
||||
#include "src/hb.h"
|
||||
#include "src/hb-ot.h"
|
||||
#include <hb.h>
|
||||
#include <hb-ot.h>
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
const char text[] = "ABCDEXYZ123@_%&)*$!";
|
||||
|
|
Loading…
Reference in New Issue