test: add cross-module tests

This commit is contained in:
2025-06-27 21:54:23 +01:00
parent 86d5b9d31d
commit 9aa75b4d0b
3 changed files with 95 additions and 0 deletions

View File

@@ -46,3 +46,17 @@ foreach (module ${b_modules})
endforeach (test_file)
endif ()
endforeach (module)
file(GLOB test_sources test/*.c)
list(REMOVE_ITEM test_sources "${CMAKE_CURRENT_SOURCE_DIR}/test/units.c")
foreach (test_file ${test_sources})
get_filename_component(test_name ${test_file} NAME_WE)
add_executable(blue-${test_name} ${test_file})
set_target_properties(blue-${test_name} PROPERTIES FOLDER "Tests")
foreach (module ${b_modules})
target_link_libraries(blue-${test_name} blue-${module})
endforeach (module)
endforeach (test_file)