summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2018-11-16 17:09:24 +0300
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-11-16 23:09:24 +0900
commita7891d203c5c8192ec16141c00a30d93e175a0cf (patch)
treedcfe23a79fd87b3b87c2c8b76a5d4dbb00347d44 /src
parentac0a94f7438b49a0890d9806db1fa211a5bca10a (diff)
downloadsystemd-a7891d203c5c8192ec16141c00a30d93e175a0cf.tar.gz
systemd-a7891d203c5c8192ec16141c00a30d93e175a0cf.tar.bz2
systemd-a7891d203c5c8192ec16141c00a30d93e175a0cf.zip
tests: run fuzzers four times in a row (#10794)
This should help to catch issues that are easily detectable by bad_build_check like the one being fixed in https://github.com/systemd/systemd/pull/10793, which would totally break the build tomorrow if I hadn't run `helper.py check_build` manually.
Diffstat (limited to 'src')
-rw-r--r--src/fuzz/fuzz-main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fuzz/fuzz-main.c b/src/fuzz/fuzz-main.c
index caf7a27ef1..cc9252377a 100644
--- a/src/fuzz/fuzz-main.c
+++ b/src/fuzz/fuzz-main.c
@@ -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;
@@ -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");
}