Files
vdm/core/tests/CMakeLists.txt
samiandClaude Sonnet 5 5ac74ecbd9 core: add build skeleton and provisional test harness
Self-contained core/CMakeLists.txt (veloxcore STATIC + velox::core alias),
warnings at target scope so the sanitizer presets' CMAKE_CXX_FLAGS override
doesn't drop -Werror. vtest: ~150-line header-only harness (VT_TEST /
VT_CHECK / VT_REQUIRE / VT_CHECK_EQ) behind a one-function vdm_add_test(),
so the swap to a real framework once PKG picks one is mechanical.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HPPSGhiArbvQgwC2DNiURS
2026-09-09 19:03:00 +04:00

23 lines
1022 B
CMake

# CORE unit tests.
#
# Harness is the provisional header-only vtest (support/vtest.hpp); PKG owns the final
# framework choice (core/docs/pkg-requests-m1.md P2). vdm_add_test() is the only thing
# test files touch, so swapping harnesses is a one-function edit.
add_library(vtest_main STATIC support/vtest_main.cpp)
target_include_directories(vtest_main PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/support)
target_compile_features(vtest_main PUBLIC cxx_std_23)
function(vdm_add_test name)
add_executable(${name} ${ARGN})
target_link_libraries(${name} PRIVATE veloxcore vtest_main)
target_compile_options(${name} PRIVATE -Wall -Wextra -Wpedantic -Werror)
add_test(NAME ${name} COMMAND ${name})
endfunction()
vdm_add_test(veloxcore_result_test util/result_test.cpp)
vdm_add_test(veloxcore_event_bus_test util/event_bus_test.cpp)
vdm_add_test(veloxcore_thread_pool_test util/thread_pool_test.cpp)
vdm_add_test(veloxcore_bytes_test util/bytes_test.cpp)
vdm_add_test(veloxcore_log_test util/log_test.cpp)