2026-04-13 11:16:58 -06:00
|
|
|
find_package(cmocka REQUIRED)
|
|
|
|
|
|
|
|
|
|
add_executable(test_arraylist test_arraylist.c)
|
|
|
|
|
|
|
|
|
|
target_link_libraries(test_arraylist
|
2026-04-23 12:23:52 -06:00
|
|
|
arraylist
|
2026-04-13 11:16:58 -06:00
|
|
|
cmocka::cmocka
|
|
|
|
|
)
|
|
|
|
|
|
2026-04-23 12:23:52 -06:00
|
|
|
# Sanitizers (portables)
|
|
|
|
|
if(ARRAYLIST_ENABLE_SANITIZERS)
|
|
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
|
|
|
|
|
target_compile_options(test_arraylist PRIVATE
|
|
|
|
|
-fsanitize=address
|
|
|
|
|
-fno-omit-frame-pointer
|
|
|
|
|
)
|
|
|
|
|
target_link_options(test_arraylist PRIVATE
|
|
|
|
|
-fsanitize=address
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
2026-04-13 11:16:58 -06:00
|
|
|
|
2026-04-23 12:23:52 -06:00
|
|
|
add_test(NAME arraylist_tests COMMAND test_arraylist)
|