From a8f4bd91c8bf0dbf4d92dfcde59e7728c616b587 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Thu, 14 Mar 2024 13:47:21 -0700 Subject: [PATCH] Use asan and ubsan for whitebox/fuzz tests --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a77b353..a5371f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,7 +154,9 @@ if(BUILD_TESTING) file(GLOB CORPUS_TESTS ${CMAKE_SOURCE_DIR}/corpus/*) add_executable(fuzz_driver ConflictSet.cpp FuzzTestDriver.cpp) - target_compile_options(fuzz_driver PRIVATE ${TEST_FLAGS}) + target_compile_options(fuzz_driver PRIVATE ${TEST_FLAGS} + -fsanitize=address,undefined) + target_link_options(fuzz_driver PRIVATE -fsanitize=address,undefined) target_compile_definitions(fuzz_driver PRIVATE ENABLE_FUZZ) target_include_directories(fuzz_driver PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)