Skip to content

Commit

Permalink
tests: run fuzzers four times in a row
Browse files Browse the repository at this point in the history
This should help to catch issues that are easily detectable by
bad_build_check like the one being fixed inhttps://github.com/systemd/pull/10793,
which would totally break the build tomorrow if I hadn't run
`helper.py check_build` manually.
  • Loading branch information
evverx committed Nov 16, 2018
1 parent 708dab4 commit 40c7cc4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/fuzz/fuzz-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
* It reads files named on the command line and passes them one by one into the
* fuzzer that it is compiled into. */

/* This one was borrowed from
* https://github.com/google/oss-fuzz/blob/646fca1b506b056db3a60d32c4a1a7398f171c94/infra/base-images/base-runner/bad_build_check#L19
*/
#define MIN_NUMBER_OF_RUNS 4

int main(int argc, char **argv) {
int i, r;
size_t size;
Expand All @@ -30,7 +35,8 @@ int main(int argc, char **argv) {
}
printf("%s... ", name);
fflush(stdout);
(void) LLVMFuzzerTestOneInput((uint8_t*)buf, size);
for (int j = 0; j < MIN_NUMBER_OF_RUNS; j++)
(void) LLVMFuzzerTestOneInput((uint8_t*)buf, size);
printf("ok\n");
}

Expand Down

0 comments on commit 40c7cc4

Please sign in to comment.