]> granicus.if.org Git - llvm/commitdiff
[libFuzzer] Add features `windows` and `posix` for lit tests.
authorMarcos Pividori <mpividori@google.com>
Wed, 1 Feb 2017 22:40:34 +0000 (22:40 +0000)
committerMarcos Pividori <mpividori@google.com>
Wed, 1 Feb 2017 22:40:34 +0000 (22:40 +0000)
Add 2 features: posix and windows.
Sometimes we want some specific tests only for posix and we use:
 REQUIRES: posix
Sometimes we want some specific tests only for windows and we use:
 REQUIRES: windows

Differential Revision: https://reviews.llvm.org/D29418

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293827 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Fuzzer/test/CMakeLists.txt
lib/Fuzzer/test/lit.cfg
lib/Fuzzer/test/lit.site.cfg.in

index 1f9999f440123d7bb85fbcf665912a88802d9ff3..7fa75a8abc58ce5d0cbd5a8c06066847be76a243 100644 (file)
@@ -226,6 +226,10 @@ set(TestBinaries ${TestBinaries} LLVMFuzzer-DSOTest)
 # Note this is done after declaring all tests so we can inform lit if any tests
 # need to be disabled.
 ###############################################################################
+set(LIBFUZZER_POSIX 1)
+if (MSVC)
+  set(LIBFUZZER_POSIX 0)
+endif()
 
 configure_lit_site_cfg(
   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
index 745af0c3824507f409d125c020b80f95c32d72d4..c3e7c3835d0ada9c3ab4bee4a315936088dad43f 100644 (file)
@@ -20,6 +20,12 @@ if config.has_lsan:
 else:
   lit_config.note('lsan feature unavailable')
 
+if sys.platform.startswith('win') or sys.platform.startswith('cygwin'):
+  config.available_features.add('windows')
+
+if config.is_posix:
+  config.available_features.add('posix')
+
 if sys.platform.startswith('linux'):
   # Note the value of ``sys.platform`` is not consistent
   # between python 2 and 3, hence the use of ``.startswith()``.
index 03e86c487ca90fa26d7df8a0de2ce965737eda42..069f2b72c0d94132139d5e71345e4209f5423843 100644 (file)
@@ -1,4 +1,5 @@
 config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
 config.has_lsan = True if @HAS_LSAN@ == 1 else False
+config.is_posix = @LIBFUZZER_POSIX@
 lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")