meta: add support for simple unit test

This commit is contained in:
2025-04-11 13:41:33 +01:00
parent 377444ef59
commit 2b603c0d75
3 changed files with 40 additions and 6 deletions

13
test/CMakeLists.txt Normal file
View File

@@ -0,0 +1,13 @@
file(GLOB test_sources *.c)
foreach (test_file ${test_sources})
get_filename_component(test_name ${test_file} NAME_WE)
add_executable(${test_name} ${test_file})
target_link_libraries(${test_name} ivy-common ivy-lang ivy-asm ivy-rt mie)
set_target_properties(${test_name} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/test"
)
endforeach (test_file)