Skip to content

Commit

Permalink
[LibFuzzer] Split the fuzzer-oom.test into two tests.
Browse files Browse the repository at this point in the history
This is necessary because the existing fuzzer-oom.test was Linux
specific due to its use of __sanitizer_print_memory_profile() which
is only available on Linux right now and so the test would fail on OSX.

Differential Revision: http://reviews.llvm.org/D20977

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272061 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
delcypher committed Jun 7, 2016
1 parent 3aa4772 commit d3e1f7d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/Fuzzer/test/fuzzer-oom-with-profile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
REQUIRES: linux
RUN: not LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=10 2>&1 | FileCheck %s
CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 10Mb)
CHECK: Live Heap Allocations
CHECK: Test unit written to ./oom-
SUMMARY: libFuzzer: out-of-memory
1 change: 0 additions & 1 deletion lib/Fuzzer/test/fuzzer-oom.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
RUN: not LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=10 2>&1 | FileCheck %s
CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 10Mb)
CHECK: Live Heap Allocations
CHECK: Test unit written to ./oom-
SUMMARY: libFuzzer: out-of-memory
8 changes: 8 additions & 0 deletions lib/Fuzzer/test/lit.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import lit.formats
import sys

config.name = "LLVMFuzzer"
config.test_format = lit.formats.ShTest(True)
Expand All @@ -25,3 +26,10 @@ if config.has_lsan:
else:
lit_config.note('lsan feature unavailable')

if sys.platform.startswith('linux'):
# Note the value of ``sys.platform`` is not consistent
# between python 2 and 3, hence the use of ``.startswith()``.
lit_config.note('linux feature available')
config.available_features.add('linux')
else:
lit_config.note('linux feature unavailable')

0 comments on commit d3e1f7d

Please sign in to comment.