# HG changeset patch # User Matt Johnston # Date 1615123594 -28800 # Node ID fd00aeff38fda34db18f73af619359ed86208c68 # Parent 42daf304461850247fd6b16cafe2572e6f3a672b fuzz: add -q quiet argument for standalone fuzzers. travis has a log length limit diff -r 42daf3044618 -r fd00aeff38fd fuzz/fuzz-harness.c --- a/fuzz/fuzz-harness.c Sun Mar 07 16:30:33 2021 +0800 +++ b/fuzz/fuzz-harness.c Sun Mar 07 21:26:34 2021 +0800 @@ -7,6 +7,7 @@ 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 @@ 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 @@ /* 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; diff -r 42daf3044618 -r fd00aeff38fd fuzzers_test.sh --- a/fuzzers_test.sh Sun Mar 07 16:30:33 2021 +0800 +++ b/fuzzers_test.sh Sun Mar 07 21:26:34 2021 +0800 @@ -7,7 +7,8 @@ test -d fuzzcorpus && hg --repository fuzzcorpus/ pull || hg clone https://hg.ucc.asn.au/dropbear-fuzzcorpus fuzzcorpus || exit 1 for f in `make list-fuzz-targets`; do # use xargs to split the too-long argument list - echo fuzzcorpus/$f/* | xargs -n 1000 ./$f || result=1 + # -q quiet because travis has a logfile limit + echo fuzzcorpus/$f/* | xargs -n 1000 ./$f -q || result=1 done exit $result