[Tarantool-patches] [PATCH v2] Add infrastructure for fuzzing testing and fuzzers

Sergey Bronnikov sergeyb at tarantool.org
Thu Apr 30 14:40:20 MSK 2020


Hi, Serge

On 14:10 Thu 30 Apr , Serge Petrenko wrote:
> diff --git a/cmake/profile.cmake b/cmake/profile.cmake
> index bc4bf67f5..419f7b3cc 100644
> --- a/cmake/profile.cmake
> +++ b/cmake/profile.cmake
> @@ -42,6 +42,15 @@ else()
>      add_definitions(-DNVALGRIND=1)
>  endif()
> 
> +option(ENABLE_FUZZER "Enable fuzzing testing" OFF)
> +if(ENABLE_FUZZER)
> +    if(NOT (CMAKE_C_COMPILER_ID STREQUAL "Clang"))
> +        message(WARNING "Fuzzing supported with Clang compiler only.")
> +    else()
> +        set(TESTING_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Testing")
> +    endif()
> +endif()
> +
>  option(ENABLE_ASAN "Enable AddressSanitizer, a fast memory error detector
> based on compiler instrumentation" OFF)
>  if (ENABLE_ASAN)
>      if (CMAKE_COMPILER_IS_GNUCC)
> 
> ===============
> 
> shouldn't it be message(FATAL_ERROR "...") ?  So  that cmake config fails.
> Otherwise it'll produce the warning, but proceed  to build anyway.

Agree, replaced it to FATAL_ERROR.

<snipped>

> +if(ENABLE_FUZZER AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
> +    set(TestName "test_csv")
> =================
> 
> If you error on compiler check, as  mentioned above, there's no need to
> check for compiler here. It's the only  place left, besides. You've omitted the
> checks in http_parser and uri  tests.

Just forgot to remove it. Fixed in a branch.

<snipped>


More information about the Tarantool-patches mailing list