summaryrefslogtreecommitdiffhomepage
path: root/fuzz
diff options
context:
space:
mode:
Diffstat (limited to 'fuzz')
-rw-r--r--fuzz/fuzz-harness.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/fuzz/fuzz-harness.c b/fuzz/fuzz-harness.c
index 331a88c..2c661d9 100644
--- a/fuzz/fuzz-harness.c
+++ b/fuzz/fuzz-harness.c
@@ -7,6 +7,7 @@ extern int LLVMFuzzerTestOneInput(const unsigned char *data, size_t size);
int main(int argc, char ** argv) {
int i;
buffer *input = buf_new(100000);
+ int quiet = 0;
for (i = 1; i < argc; i++) {
#if DEBUG_TRACE
@@ -15,6 +16,10 @@ int main(int argc, char ** argv) {
TRACE(("debug printing on"))
}
#endif
+ if (strcmp(argv[i], "-q") == 0) {
+ printf("Running quiet\n");
+ quiet = 1;
+ }
}
int old_fuzz_wrapfds = 0;
@@ -31,11 +36,17 @@ int main(int argc, char ** argv) {
/* Run twice to catch problems with statefulness */
fuzz.wrapfds = old_fuzz_wrapfds;
- printf("Running %s once \n", fn);
+ if (!quiet) {
+ printf("Running %s once \n", fn);
+ }
LLVMFuzzerTestOneInput(input->data, input->len);
- printf("Running %s twice \n", fn);
+ if (!quiet) {
+ printf("Running %s twice \n", fn);
+ }
LLVMFuzzerTestOneInput(input->data, input->len);
- printf("Done %s\n", fn);
+ if (!quiet) {
+ printf("Done %s\n", fn);
+ }
/* Disable wrapfd so it won't interfere with buf_readfile() above */
old_fuzz_wrapfds = fuzz.wrapfds;