[PATCH] D20947: [LibFuzzer] Disable building and running LSan tests on Apple platforms because LSan is not currently supported.

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


delcypher updated this revision to Diff 59802.
delcypher added a comment.

- Build all tests, even the ones we aren't going to run
- Fix Sanitizer marketing s/leak sanitizer/LeakSanitizer/.


http://reviews.llvm.org/D20947

Files:
  lib/Fuzzer/test/CMakeLists.txt
  lib/Fuzzer/test/fuzzer-leak.test
  lib/Fuzzer/test/lit.cfg
  lib/Fuzzer/test/lit.site.cfg.in

Index: lib/Fuzzer/test/lit.site.cfg.in
===================================================================
--- lib/Fuzzer/test/lit.site.cfg.in
+++ lib/Fuzzer/test/lit.site.cfg.in
@@ -1,4 +1,5 @@
 config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
 config.has_dfsan = True if @HAS_DFSAN@ == 1 else False
+config.has_lsan = True if @HAS_LSAN@ == 1 else False
 lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")
Index: lib/Fuzzer/test/lit.cfg
===================================================================
--- lib/Fuzzer/test/lit.cfg
+++ lib/Fuzzer/test/lit.cfg
@@ -19,3 +19,9 @@
 else:
   lit_config.note('dfsan feature unavailable')
 
+if config.has_lsan:
+  lit_config.note('lsan feature available')
+  config.available_features.add('lsan')
+else:
+  lit_config.note('lsan feature unavailable')
+
Index: lib/Fuzzer/test/fuzzer-leak.test
===================================================================
--- lib/Fuzzer/test/fuzzer-leak.test
+++ lib/Fuzzer/test/fuzzer-leak.test
@@ -1,3 +1,4 @@
+REQUIRES: lsan
 RUN: not LLVMFuzzer-LeakTest -runs=100000 -detect_leaks=1 2>&1 | FileCheck %s --check-prefix=LEAK_DURING
 LEAK_DURING: ERROR: LeakSanitizer: detected memory leaks
 LEAK_DURING: Direct leak of 4 byte(s) in 1 object(s) allocated from:
Index: lib/Fuzzer/test/CMakeLists.txt
===================================================================
--- lib/Fuzzer/test/CMakeLists.txt
+++ lib/Fuzzer/test/CMakeLists.txt
@@ -93,6 +93,16 @@
   TimeoutTest
   )
 
+if(APPLE)
+  # LeakSanitizer is not supported on OSX right now
+  set(HAS_LSAN 0)
+  message(WARNING "LeakSanitizer is not supported on Apple platforms."
+    " Building and running LibFuzzer LeakSanitizer tests is disabled."
+    )
+else()
+  set(HAS_LSAN 1)
+endif()
+
 foreach(Test ${Tests})
   add_libfuzzer_test(${Test} SOURCES ${Test}.cpp)
 endforeach()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20947.59802.patch
Type: text/x-patch
Size: 1892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160606/e722b365/attachment.bin>


More information about the llvm-commits mailing list