diff options
author | Marcos Pividori <mpividori@google.com> | 2017-02-01 22:40:34 +0000 |
---|---|---|
committer | Marcos Pividori <mpividori@google.com> | 2017-02-01 22:40:34 +0000 |
commit | 9c0244c1eb4d2c42bcaa7d73fe626fd6e1951527 (patch) | |
tree | 1c9a5bd6aa2ebc30ab4d887fe0d2c98aa8dee23d /llvm/lib/Fuzzer/test | |
parent | 477d15304539ac647e842d4f062c025474b34252 (diff) | |
download | bcm5719-llvm-9c0244c1eb4d2c42bcaa7d73fe626fd6e1951527.tar.gz bcm5719-llvm-9c0244c1eb4d2c42bcaa7d73fe626fd6e1951527.zip |
[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
llvm-svn: 293827
Diffstat (limited to 'llvm/lib/Fuzzer/test')
-rw-r--r-- | llvm/lib/Fuzzer/test/CMakeLists.txt | 4 | ||||
-rw-r--r-- | llvm/lib/Fuzzer/test/lit.cfg | 6 | ||||
-rw-r--r-- | llvm/lib/Fuzzer/test/lit.site.cfg.in | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/test/CMakeLists.txt b/llvm/lib/Fuzzer/test/CMakeLists.txt index 1f9999f4401..7fa75a8abc5 100644 --- a/llvm/lib/Fuzzer/test/CMakeLists.txt +++ b/llvm/lib/Fuzzer/test/CMakeLists.txt @@ -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 diff --git a/llvm/lib/Fuzzer/test/lit.cfg b/llvm/lib/Fuzzer/test/lit.cfg index 745af0c3824..c3e7c3835d0 100644 --- a/llvm/lib/Fuzzer/test/lit.cfg +++ b/llvm/lib/Fuzzer/test/lit.cfg @@ -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()``. diff --git a/llvm/lib/Fuzzer/test/lit.site.cfg.in b/llvm/lib/Fuzzer/test/lit.site.cfg.in index 03e86c487ca..069f2b72c0d 100644 --- a/llvm/lib/Fuzzer/test/lit.site.cfg.in +++ b/llvm/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_lsan = True if @HAS_LSAN@ == 1 else False +config.is_posix = @LIBFUZZER_POSIX@ lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg") |