[libFuzzer] Add features windows and posix for lit tests.

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
This commit is contained in:
Marcos Pividori 2017-02-01 22:40:34 +00:00
parent adb057cab2
commit b928b9b13e
3 changed files with 11 additions and 0 deletions

View 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 # Note this is done after declaring all tests so we can inform lit if any tests
# need to be disabled. # need to be disabled.
############################################################################### ###############################################################################
set(LIBFUZZER_POSIX 1)
if (MSVC)
set(LIBFUZZER_POSIX 0)
endif()
configure_lit_site_cfg( configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in

View File

@ -20,6 +20,12 @@ if config.has_lsan:
else: else:
lit_config.note('lsan feature unavailable') 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'): if sys.platform.startswith('linux'):
# Note the value of ``sys.platform`` is not consistent # Note the value of ``sys.platform`` is not consistent
# between python 2 and 3, hence the use of ``.startswith()``. # between python 2 and 3, hence the use of ``.startswith()``.

View File

@ -1,4 +1,5 @@
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@" config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.has_lsan = True if @HAS_LSAN@ == 1 else False 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") lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")