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

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 6 16:45:46 PDT 2016


delcypher retitled this revision from "[LibFuzzer] Fix fuzzer-oom.test on OSX." to "[LibFuzzer] Split the fuzzer-oom.test into two tests.".
delcypher updated the summary for this revision.
delcypher updated this revision to Diff 59804.
delcypher added a comment.

Rework patch. Maybe I should use XFAIL rather than REQUIRES here?


http://reviews.llvm.org/D20977

Files:
  lib/Fuzzer/test/fuzzer-oom-darwin.test
  lib/Fuzzer/test/fuzzer-oom-linux.test
  lib/Fuzzer/test/fuzzer-oom.test
  lib/Fuzzer/test/lit.cfg

Index: lib/Fuzzer/test/lit.cfg
===================================================================
--- lib/Fuzzer/test/lit.cfg
+++ lib/Fuzzer/test/lit.cfg
@@ -1,4 +1,5 @@
 import lit.formats
+import sys
 
 config.name = "LLVMFuzzer"
 config.test_format = lit.formats.ShTest(True)
@@ -25,3 +26,16 @@
 else:
   lit_config.note('lsan feature unavailable')
 
+# Add host platform as a feature
+hostPlatform = None
+if sys.platform == 'darwin':
+  hostPlatform = 'darwin'
+elif sys.platform.startswith('linux'):
+  # Note the value of ``sys.platform`` is not consistent
+  # between python 2 and 3, hence the use of ``.startswith()``.
+  hostPlatform = 'linux'
+else:
+  lit_config.fatal('Platform "{}" is not supported.'.format(sys.platform))
+lit_config.note('Host platform is {}'.format(hostPlatform))
+config.available_features.add(hostPlatform)
+
Index: lib/Fuzzer/test/fuzzer-oom.test
===================================================================
--- lib/Fuzzer/test/fuzzer-oom.test
+++ /dev/null
@@ -1,5 +0,0 @@
-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
Index: lib/Fuzzer/test/fuzzer-oom-linux.test
===================================================================
--- /dev/null
+++ lib/Fuzzer/test/fuzzer-oom-linux.test
@@ -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
Index: lib/Fuzzer/test/fuzzer-oom-darwin.test
===================================================================
--- /dev/null
+++ lib/Fuzzer/test/fuzzer-oom-darwin.test
@@ -0,0 +1,5 @@
+REQUIRES: darwin
+RUN: not LLVMFuzzer-OutOfMemoryTest -rss_limit_mb=10 2>&1 | FileCheck %s
+CHECK: ERROR: libFuzzer: out-of-memory (used: {{.*}}; limit: 10Mb)
+CHECK: Test unit written to ./oom-
+SUMMARY: libFuzzer: out-of-memory


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20977.59804.patch
Type: text/x-patch
Size: 2126 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160606/0b32c0e1/attachment.bin>


More information about the llvm-commits mailing list