[LibFuzzer] Split the fuzzer-oom.test into two tests.

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

llvm-svn: 272061
This commit is contained in:
Dan Liew 2016-06-07 21:23:30 +00:00
parent 536434e80f
commit 1d0a9fd089
3 changed files with 14 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,5 @@
import lit.formats
import sys
config.name = "LLVMFuzzer"
config.test_format = lit.formats.ShTest(True)
@ -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')