summaryrefslogtreecommitdiff
path: root/tests/fuzz/Makefile.am
blob: 5f4d90b67e437e878c72fbcf094ab112d74557c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
LIBXSLT_LIBS = $(top_builddir)/libxslt/libxslt.la \
               $(top_builddir)/libexslt/libexslt.la

EXTRA_PROGRAMS = xpath xslt
check_PROGRAMS = testTargets
EXTRA_DIST = xpath.dict xpath.xml xslt.dict xslt.xml seed
CLEANFILES = $(EXTRA_PROGRAMS)
AM_CPPFLAGS = -I$(top_srcdir)
AM_CFLAGS = $(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)
DEPENDENCIES = $(LIBXSLT_LIBS)
LDADD = $(LIBXSLT_LIBS) \
        $(LIBXML_LIBS) $(EXTRA_LIBS) $(LIBM)

xpath_SOURCES = xpath.c fuzz.c fuzz.h
xpath_LDFLAGS = -fsanitize=fuzzer

xslt_SOURCES = xslt.c fuzz.c fuzz.h
xslt_LDFLAGS = -fsanitize=fuzzer

testTargets_SOURCES = testTargets.c fuzz.c fuzz.h

$(top_builddir)/libxslt/libxslt.la:
	cd $(top_builddir)/libxslt && $(MAKE) libxslt.la

$(top_builddir)/libexslt/libexslt.la: $(top_builddir)/libxslt/libxslt.la
	cd $(top_builddir)/libexslt && $(MAKE) libexslt.la

.PHONY: tests fuzz-xpath fuzz-xslt

tests:

fuzz: $(check_PROGRAMS)
	@echo '## Running fuzz target tests'
	@./testTargets $(srcdir)

fuzz-xpath: xpath$(EXEEXT)
	@mkdir -p corpus/xpath
	./xpath$(EXEEXT) \
            -max_len=256 \
            -dict=$(srcdir)/xpath.dict \
	    corpus/xpath $(srcdir)/seed/xpath

fuzz-xslt: xslt$(EXEEXT)
	@mkdir -p corpus/xslt
	./xslt$(EXEEXT) \
            -dict=$(srcdir)/xslt.dict \
	    corpus/xslt $(srcdir)/seed/xslt