Factor out the zint_add_test macro

This commit is contained in:
Schaich 2021-03-29 23:46:13 +09:00
parent b69df5ad91
commit 3114a6697b
3 changed files with 19 additions and 23 deletions

View file

@ -8,16 +8,6 @@ project(zint_frontend_tests)
enable_testing()
macro(zint_add_test test_name test_command)
set(ADDITIONAL_LIBS "${ARGN}" ${LIBRARY_FLAGS})
add_executable(${test_command} ${test_command}.c)
target_link_libraries(${test_command} testcommon ${ADDITIONAL_LIBS})
add_test(${test_name} ${test_command})
if(ZINT_STATIC)
add_executable(${test_command}-static ${test_command}.c)
target_link_libraries(${test_command}-static testcommon-static ${ADDITIONAL_LIBS})
add_test(${test_name}-static ${test_command}-static)
endif()
endmacro()
include(${zint-package_SOURCE_DIR}/cmake/zint_add_test.cmake)
zint_add_test(args test_args)