VirtualBox

source: vbox/trunk/src/libs/libxml2-2.12.6/fuzz/Makefile.am@ 105132

最後變更 在這個檔案從105132是 104106,由 vboxsync 提交於 12 月 前

libxml2-2.9.14: Applied and adjusted our libxml2 changes to 2.9.14. bugref:10640

  • 屬性 svn:eol-style 設為 native
檔案大小: 4.7 KB
 
1AUTOMAKE_OPTIONS = -Wno-syntax
2EXTRA_PROGRAMS = genSeed html regexp schema uri valid xinclude xml xpath
3check_PROGRAMS = testFuzzer
4EXTRA_DIST = html.dict regexp.dict schema.dict xml.dict xpath.dict \
5 static_seed/uri static_seed/regexp fuzz.h
6CLEANFILES = $(EXTRA_PROGRAMS)
7AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
8DEPENDENCIES = $(top_builddir)/libxml2.la
9LDADD = $(top_builddir)/libxml2.la
10
11XML_MAX_LEN = 80000
12# Single quotes to avoid wildcard expansion by the shell
13XML_SEED_CORPUS_SRC = \
14 '$(top_srcdir)/test/*' \
15 '$(top_srcdir)/test/errors/*.xml' \
16 '$(top_srcdir)/test/errors10/*.xml' \
17 '$(top_srcdir)/test/namespaces/*' \
18 '$(top_srcdir)/test/recurse/*.xml' \
19 '$(top_srcdir)/test/SVG/*.xml' \
20 '$(top_srcdir)/test/valid/*.xml' \
21 '$(top_srcdir)/test/VC/*' \
22 '$(top_srcdir)/test/VCM/*' \
23 '$(top_srcdir)/test/xmlid/*'
24
25testFuzzer_SOURCES = testFuzzer.c fuzz.c
26
27.PHONY: corpus clean-corpus
28
29corpus: seed/html.stamp seed/regexp.stamp seed/schema.stamp seed/uri.stamp \
30 seed/valid.stamp seed/xinclude.stamp seed/xml.stamp seed/xpath.stamp
31
32check-local: corpus
33 ./testFuzzer$(EXEEXT)
34
35clean-corpus:
36 rm -rf seed
37
38clean-local: clean-corpus
39
40# Seed corpus
41
42genSeed_SOURCES = genSeed.c fuzz.c
43
44# XML fuzzer
45
46seed/xml.stamp: genSeed$(EXEEXT)
47 @mkdir -p seed/xml
48 ./genSeed$(EXEEXT) xml $(XML_SEED_CORPUS_SRC)
49 @touch seed/xml.stamp
50
51xml_SOURCES = xml.c fuzz.c
52xml_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
53
54fuzz-xml: xml$(EXEEXT) seed/xml.stamp
55 @mkdir -p corpus/xml
56 ./xml$(EXEEXT) \
57 -dict=xml.dict \
58 -max_len=$(XML_MAX_LEN) \
59 -timeout=20 \
60 -rss_limit_mb=4096 \
61 corpus/xml seed/xml
62
63# DTD validation fuzzer
64
65seed/valid.stamp: genSeed$(EXEEXT)
66 @mkdir -p seed/valid
67 ./genSeed$(EXEEXT) valid $(XML_SEED_CORPUS_SRC)
68 @touch seed/valid.stamp
69
70valid_SOURCES = valid.c fuzz.c
71valid_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
72
73fuzz-valid: valid$(EXEEXT) seed/valid.stamp
74 @mkdir -p corpus/valid
75 ./valid$(EXEEXT) \
76 -dict=xml.dict \
77 -max_len=$(XML_MAX_LEN) \
78 -timeout=20 \
79 -rss_limit_mb=4096 \
80 corpus/valid seed/valid
81
82# XInclude fuzzer
83
84seed/xinclude.stamp: genSeed$(EXEEXT)
85 @mkdir -p seed/xinclude
86 ./genSeed$(EXEEXT) xinclude \
87 '$(top_srcdir)/test/XInclude/docs/*' \
88 '$(top_srcdir)/test/XInclude/without-reader/*'
89 @touch seed/xinclude.stamp
90
91xinclude_SOURCES = xinclude.c fuzz.c
92xinclude_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
93
94fuzz-xinclude: xinclude$(EXEEXT) seed/xinclude.stamp
95 @mkdir -p corpus/xinclude
96 ./xinclude$(EXEEXT) \
97 -dict=xml.dict \
98 -max_len=$(XML_MAX_LEN) \
99 -timeout=20 \
100 -rss_limit_mb=4096 \
101 corpus/xinclude seed/xinclude
102
103# HTML fuzzer
104
105seed/html.stamp: genSeed$(EXEEXT)
106 @mkdir -p seed/html
107 ./genSeed$(EXEEXT) html '$(top_srcdir)/test/HTML/*'
108 @touch seed/html.stamp
109
110html_SOURCES = html.c fuzz.c
111html_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
112
113fuzz-html: html$(EXEEXT) seed/html.stamp
114 @mkdir -p corpus/html
115 ./html$(EXEEXT) \
116 -dict=html.dict \
117 -max_len=1000000 \
118 -timeout=10 \
119 -rss_limit_mb=4096 \
120 corpus/html seed/html
121
122# Regexp fuzzer
123
124seed/regexp.stamp:
125 @mkdir -p seed/regexp
126 cp -r $(srcdir)/static_seed/regexp seed
127 @touch seed/regexp.stamp
128
129regexp_SOURCES = regexp.c fuzz.c
130regexp_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
131
132fuzz-regexp: regexp$(EXEEXT) seed/regexp.stamp
133 @mkdir -p corpus/regexp
134 ./regexp$(EXEEXT) \
135 -dict=regexp.dict \
136 -max_len=200 \
137 -timeout=5 \
138 corpus/regexp seed/regexp
139
140# URI fuzzer
141
142seed/uri.stamp:
143 @mkdir -p seed/uri
144 cp -r $(srcdir)/static_seed/uri seed
145 @touch seed/uri.stamp
146
147uri_SOURCES = uri.c fuzz.c
148uri_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
149
150fuzz-uri: uri$(EXEEXT) seed/uri.stamp
151 @mkdir -p corpus/uri
152 ./uri$(EXEEXT) \
153 -max_len=10000 \
154 -timeout=2 \
155 corpus/uri seed/uri
156
157# XML Schema fuzzer
158
159seed/schema.stamp: genSeed$(EXEEXT)
160 @mkdir -p seed/schema
161 ./genSeed$(EXEEXT) schema '$(top_srcdir)/test/schemas/*.xsd'
162 @touch seed/schema.stamp
163
164schema_SOURCES = schema.c fuzz.c
165schema_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
166
167fuzz-schema: schema$(EXEEXT) seed/schema.stamp
168 @mkdir -p corpus/schema
169 ./schema$(EXEEXT) \
170 -dict=schema.dict \
171 -max_len=$(XML_MAX_LEN) \
172 -timeout=20 \
173 -rss_limit_mb=4096 \
174 corpus/schema seed/schema
175
176# XPath fuzzer
177
178seed/xpath.stamp: genSeed$(EXEEXT)
179 @mkdir -p seed/xpath
180 ./genSeed$(EXEEXT) xpath '$(top_srcdir)/test/XPath'
181 @touch seed/xpath.stamp
182
183xpath_SOURCES = xpath.c fuzz.c
184xpath_LDFLAGS = $(AM_LDFLAGS) -fsanitize=fuzzer
185
186fuzz-xpath: xpath$(EXEEXT) seed/xpath.stamp
187 @mkdir -p corpus/xpath
188 ./xpath$(EXEEXT) \
189 -dict=xpath.dict \
190 -max_len=10000 \
191 -timeout=20 \
192 -rss_limit_mb=4096 \
193 corpus/xpath seed/xpath
194
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette