forked from OSchip/llvm-project
[libFuzzer tests] Only enable libFuzzer tests if
-DLIBFUZZER_ENABLE_TESTS=ON is set. llvm-svn: 310100
This commit is contained in:
parent
3fed079f8c
commit
b0c2bb572d
|
@ -628,8 +628,7 @@ LibFuzzer is built as a part of LLVM project by default on macos and Linux.
|
|||
Users of other operating systems can explicitly request compilation using
|
||||
``-DLIBFUZZER_ENABLE=YES`` flag.
|
||||
Tests are run using ``check-fuzzer`` target from the build directory
|
||||
(note that tests will take a long time to run if the compiler was compiled
|
||||
without optimizations):
|
||||
which was configured with ``-DLIBFUZZER_ENABLE_TESTS=ON`` flag.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ endif()
|
|||
# Compile libFuzzer if the compilation is specifically requested, OR
|
||||
# if the platform is known to be working.
|
||||
set(LIBFUZZER_ENABLE ${LIBFUZZER_ENABLED_CHECK} CACHE BOOL "Build libFuzzer and its tests")
|
||||
set(LIBFUZZER_ENABLE_TESTS OFF CACHE BOOL "Build libFuzzer and its tests")
|
||||
|
||||
if (LIBFUZZER_ENABLE)
|
||||
add_library(LLVMFuzzerNoMainObjects OBJECT
|
||||
|
@ -65,7 +66,7 @@ if (MSVC)
|
|||
add_custom_command(TARGET check-fuzzer
|
||||
COMMAND cmake -E echo "check-fuzzer is disalbed on Windows")
|
||||
else()
|
||||
if (LLVM_INCLUDE_TESTS AND LIBFUZZER_ENABLE)
|
||||
if (LLVM_INCLUDE_TESTS AND LIBFUZZER_ENABLE_TESTS)
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -47,7 +47,6 @@ include_directories(..)
|
|||
set(LIBFUZZER_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
|
||||
set(LIBFUZZER_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
|
||||
|
||||
if ((TARGET asan) AND (TARGET clang))
|
||||
# LIT-based libFuzzer tests.
|
||||
configure_lit_site_cfg(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
||||
|
@ -65,5 +64,3 @@ if ((TARGET asan) AND (TARGET clang))
|
|||
DEPENDS LLVMFuzzer-Unittest)
|
||||
|
||||
add_dependencies(check-fuzzer LLVMFuzzer asan clang llvm-symbolizer FileCheck sancov not)
|
||||
endif()
|
||||
|
||||
|
|
Loading…
Reference in New Issue