summaryrefslogtreecommitdiff
path: root/test/fuzzer/max-number-of-runs.test
diff options
context:
space:
mode:
authorMax Moroz <mmoroz@chromium.org>2017-09-12 02:01:54 +0000
committerMax Moroz <mmoroz@chromium.org>2017-09-12 02:01:54 +0000
commit79d3d0a1edcec3f199f8de2e6b937017a7bb044b (patch)
treefbbd88ae4603babc9cd508380a691427e7172c52 /test/fuzzer/max-number-of-runs.test
parenta16d671c83feef2f63925d62a581a2fc32a97d5e (diff)
[libfuzzer] Compare TotalNumberOfRuns with MaxNumberOfRuns when testing a memory leak.
Summary: Fuzzer::TryDetectingAMemoryLeak may call ExecuteCallback which would increment TotalNumberOfRuns, but it doesn't respect Options.MaxNumberOfRuns value specified by a user. Context: https://github.com/google/oss-fuzz/issues/822#issuecomment-328153970 Reviewers: kcc Reviewed By: kcc Differential Revision: https://reviews.llvm.org/D37632 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/fuzzer/max-number-of-runs.test')
-rw-r--r--test/fuzzer/max-number-of-runs.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/fuzzer/max-number-of-runs.test b/test/fuzzer/max-number-of-runs.test
new file mode 100644
index 000000000..efe7a9c0f
--- /dev/null
+++ b/test/fuzzer/max-number-of-runs.test
@@ -0,0 +1,10 @@
+RUN: %cpp_compiler %S/AccumulateAllocationsTest.cpp -o %t-AccumulateAllocationsTest
+
+RUN: %t-AccumulateAllocationsTest -seed=1 -runs=2 2>&1 | FileCheck %s --check-prefix=CHECK1
+CHECK1: Done 2 runs
+
+RUN: %t-AccumulateAllocationsTest -seed=1 -runs=3 2>&1 | FileCheck %s --check-prefix=CHECK2
+CHECK2: Done 3 runs
+
+RUN: %t-AccumulateAllocationsTest -seed=1 -runs=4 2>&1 | FileCheck %s --check-prefix=CHECK3
+CHECK3: Done 4 runs