stuff-from-scratch/test/CMakeLists.txt
2023-01-18 13:29:31 +00:00

49 lines
1.5 KiB
CMake

add_subdirectory(test_utils)
add_subdirectory(ui_controls)
file(COPY data/ DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_data)
set(TEST_MODULES
audio
compiler
compression
core
database
fonts
geometry
graphics
image
ipc
network
mesh
publishing
video
web
windows)
foreach(module ${TEST_MODULES})
add_subdirectory(${module})
string(TOUPPER ${module} MODULE_UPPER)
list(APPEND UNIT_TEST_FILES ${${MODULE_UPPER}_UNIT_TEST_FILES})
list(APPEND UNIT_TEST_DEPENDENCIES ${${MODULE_UPPER}_UNIT_TEST_DEPENDENCIES})
list(APPEND INTEGRATION_TEST_FILES ${${MODULE_UPPER}_INTEGRATION_TEST_FILES})
list(APPEND INTEGRATION_TEST_DEPENDENCIES ${${MODULE_UPPER}_INTEGRATION_TEST_DEPENDENCIES})
list(APPEND UI_TEST_FILES ${${MODULE_UPPER}_UI_TEST_FILES})
list(APPEND UI_TEST_DEPENDENCIES ${${MODULE_UPPER}_UI_TEST_DEPENDENCIES})
endforeach()
add_executable(unit_tests test_runner.cpp ${UNIT_TEST_FILES})
target_link_libraries(unit_tests PUBLIC test_utils ${UNIT_TEST_DEPENDENCIES})
set_property(TARGET unit_tests PROPERTY FOLDER test)
add_executable(integration_tests test_runner.cpp ${INTEGRATION_TEST_FILES})
target_link_libraries(integration_tests PUBLIC test_utils ${INTEGRATION_TEST_DEPENDENCIES})
set_property(TARGET integration_tests PROPERTY FOLDER test)
add_executable(ui_tests WIN32 ui_test_runner.cpp ${UI_TEST_FILES})
target_link_libraries(ui_tests PUBLIC test_utils ${UI_TEST_DEPENDENCIES})
set_property(TARGET ui_tests PROPERTY FOLDER test)