24 lines
524 B
CMake
24 lines
524 B
CMake
|
|
find_package(cmocka REQUIRED)
|
||
|
|
|
||
|
|
add_executable(test_graph test_graph.c)
|
||
|
|
|
||
|
|
target_link_libraries(test_graph
|
||
|
|
graph
|
||
|
|
cmocka::cmocka
|
||
|
|
)
|
||
|
|
|
||
|
|
# Sanitizers (portables)
|
||
|
|
if(ARRAYLIST_ENABLE_SANITIZERS)
|
||
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
|
||
|
|
target_compile_options(test_graph PRIVATE
|
||
|
|
-fsanitize=address
|
||
|
|
-fno-omit-frame-pointer
|
||
|
|
)
|
||
|
|
target_link_options(test_graph PRIVATE
|
||
|
|
-fsanitize=address
|
||
|
|
)
|
||
|
|
endif()
|
||
|
|
endif()
|
||
|
|
|
||
|
|
add_test(NAME graph_tests COMMAND test_graph)
|