Update test/CMakeLists.txt
This commit is contained in:
@@ -3,13 +3,21 @@ find_package(cmocka REQUIRED)
|
|||||||
add_executable(test_arena test_arena.c)
|
add_executable(test_arena test_arena.c)
|
||||||
|
|
||||||
target_link_libraries(test_arena
|
target_link_libraries(test_arena
|
||||||
arena_lib
|
arena
|
||||||
cmocka::cmocka
|
cmocka::cmocka
|
||||||
)
|
)
|
||||||
|
|
||||||
enable_sanitizers(test_arena)
|
# Sanitizers (solo si están activados y el compilador lo soporta)
|
||||||
|
if(ARENA_ENABLE_SANITIZERS)
|
||||||
target_compile_options(test_arena PRIVATE -fsanitize=address -fno-omit-frame-pointer)
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
|
||||||
target_link_options(test_arena PRIVATE -fsanitize=address)
|
target_compile_options(test_arena PRIVATE
|
||||||
|
-fsanitize=address
|
||||||
|
-fno-omit-frame-pointer
|
||||||
|
)
|
||||||
|
target_link_options(test_arena PRIVATE
|
||||||
|
-fsanitize=address
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_test(NAME arena_tests COMMAND test_arena)
|
add_test(NAME arena_tests COMMAND test_arena)
|
||||||
|
|||||||
Reference in New Issue
Block a user