@@ -32,7 +32,9 @@ def fuzzing_decoration(
32
32
dicts = None ,
33
33
instrument_binary = True ,
34
34
define_regression_test = True ,
35
- test_tags = None ):
35
+ test_size = None ,
36
+ test_tags = None ,
37
+ test_timeout = None ):
36
38
"""Generates the standard targets associated to a fuzz test.
37
39
38
40
This macro can be used to define custom fuzz test rules in case the default
@@ -62,7 +64,9 @@ def fuzzing_decoration(
62
64
default instrumentation mode does not work for your use case, please
63
65
file a Github issue to discuss.
64
66
define_regression_test: If true, generate a regression test rule.
67
+ test_size: The size of the fuzzing regression test.
65
68
test_tags: Tags set on the fuzzing regression test.
69
+ test_timeout: The timeout for the fuzzing regression test.
66
70
"""
67
71
68
72
# We tag all non-test targets as "manual" in order to optimize the build
@@ -122,7 +126,9 @@ def fuzzing_decoration(
122
126
fuzzing_regression_test (
123
127
name = name ,
124
128
binary = instrum_binary_name ,
129
+ size = test_size ,
125
130
tags = test_tags ,
131
+ timeout = test_timeout ,
126
132
)
127
133
128
134
oss_fuzz_package (
@@ -138,7 +144,9 @@ def cc_fuzz_test(
138
144
corpus = None ,
139
145
dicts = None ,
140
146
engine = "@rules_fuzzing//fuzzing:cc_engine" ,
147
+ size = None ,
141
148
tags = None ,
149
+ timeout = None ,
142
150
** binary_kwargs ):
143
151
"""Defines a C++ fuzz test and a few associated tools and metadata.
144
152
@@ -164,7 +172,11 @@ def cc_fuzz_test(
164
172
corpus: A list containing corpus files.
165
173
dicts: A list containing dictionaries.
166
174
engine: A label pointing to the fuzzing engine to use.
167
- tags: Tags set on the fuzzing regression test.
175
+ size: The size of the regression test. This does *not* affect fuzzing
176
+ itself. Takes the [common size values](https://bazel.build/reference/be/common-definitions#test.size).
177
+ tags: Tags set on the regression test.
178
+ timeout: The timeout for the regression test. This does *not* affect
179
+ fuzzing itself. Takes the [common timeout values](https://docs.bazel.build/versions/main/be/common-definitions.html#test.timeout).
168
180
**binary_kwargs: Keyword arguments directly forwarded to the fuzz test
169
181
binary rule.
170
182
"""
@@ -194,9 +206,11 @@ def cc_fuzz_test(
194
206
engine = engine ,
195
207
corpus = corpus ,
196
208
dicts = dicts ,
209
+ test_size = size ,
197
210
test_tags = (tags or []) + [
198
211
"fuzz-test" ,
199
212
],
213
+ test_timeout = timeout ,
200
214
)
201
215
202
216
def java_fuzz_test (
@@ -206,7 +220,9 @@ def java_fuzz_test(
206
220
corpus = None ,
207
221
dicts = None ,
208
222
engine = "@rules_fuzzing//fuzzing:java_engine" ,
223
+ size = None ,
209
224
tags = None ,
225
+ timeout = None ,
210
226
** binary_kwargs ):
211
227
"""Defines a Java fuzz test and a few associated tools and metadata.
212
228
@@ -235,7 +251,11 @@ def java_fuzz_test(
235
251
corpus: A list containing corpus files.
236
252
dicts: A list containing dictionaries.
237
253
engine: A label pointing to the fuzzing engine to use.
238
- tags: Tags set on the fuzzing regression test.
254
+ size: The size of the regression test. This does *not* affect fuzzing
255
+ itself. Takes the [common size values](https://bazel.build/reference/be/common-definitions#test.size).
256
+ tags: Tags set on the regression test.
257
+ timeout: The timeout for the regression test. This does *not* affect
258
+ fuzzing itself. Takes the [common timeout values](https://docs.bazel.build/versions/main/be/common-definitions.html#test.timeout).
239
259
**binary_kwargs: Keyword arguments directly forwarded to the fuzz test
240
260
binary rule.
241
261
"""
@@ -316,7 +336,9 @@ def java_fuzz_test(
316
336
engine = engine ,
317
337
corpus = corpus ,
318
338
dicts = dicts ,
339
+ test_size = size ,
319
340
test_tags = (tags or []) + [
320
341
"fuzz-test" ,
321
342
],
343
+ test_timeout = timeout ,
322
344
)
0 commit comments