summaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
blob: 82764759750c795327ef9fb06a45eec428359d96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

find_package(Boost CONFIG COMPONENTS unit_test_framework REQUIRED)

file(GLOB KATJA_TEST_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)

foreach(test_source ${KATJA_TEST_SOURCES})
	get_filename_component(test_name ${test_source} NAME_WE)
	set(tester ${test_name}-tester)

	add_executable(${tester} ${test_source})

	target_compile_definitions(${tester} PRIVATE "BOOST_TEST_DYN_LINK=1")
	target_link_libraries(${tester} LINK_PRIVATE katja Boost::unit_test_framework)

	add_test(NAME ${test_name} COMMAND ${tester})
endforeach()