1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-01 16:32:31 +01:00
openrw/tests/CMakeLists.txt

103 lines
1.6 KiB
CMake
Raw Normal View History

set(TESTS
Animation
Archive
AudioLoading
Buoyancy
Character
Chase
Config
Cutscene
Data
FileIndex
GameData
GameWorld
2018-05-31 22:38:47 +02:00
Garage
2018-11-18 13:58:12 +01:00
HitTest
Input
Items
Lifetime
LoaderDFF
LoaderIDE
LoaderIPL
Logger
Menu
Object
2018-06-18 06:24:34 +02:00
Payphone
Pickup
Renderer
RWBStream
SaveGame
ScriptMachine
State
StringEncoding
Sound
Text
TrafficDirector
Vehicle
2019-05-24 00:38:35 +02:00
ViewCamera
VisualFX
Weapon
World
ZoneData
)
set(TEST_SOURCES
2017-10-26 01:03:15 +02:00
main.cpp
test_Globals.cpp
test_Globals.hpp
2017-10-26 01:03:15 +02:00
)
2013-09-11 13:10:42 +02:00
foreach(TEST ${TESTS})
list(APPEND TEST_SOURCES "test_${TEST}.cpp")
endforeach()
add_executable(rwtests
${TEST_SOURCES}
)
2013-09-11 13:10:42 +02:00
target_include_directories(rwtests
PRIVATE
2018-06-24 00:43:06 +02:00
"${PROJECT_SOURCE_DIR}/tests"
"${PROJECT_SOURCE_DIR}/rwgame"
)
2013-09-11 13:10:42 +02:00
target_link_libraries(rwtests
2017-10-26 01:03:15 +02:00
PRIVATE
2018-07-06 02:25:48 +02:00
Boost::unit_test_framework
2018-12-19 01:18:29 +01:00
librwgame
2017-10-26 01:03:15 +02:00
)
2013-09-11 13:10:42 +02:00
2018-09-01 18:23:10 +02:00
openrw_target_apply_options(
TARGET rwtests
CORE
COVERAGE
2018-09-01 18:23:10 +02:00
INSTALL INSTALL_PDB
)
2017-11-03 23:59:02 +01:00
if(SEPARATE_TEST_SUITES)
foreach(TEST ${TESTS})
add_test(
NAME "${TEST}"
COMMAND "$<TARGET_FILE:rwtests>" "-t" "${TEST}Tests"
)
set_tests_properties("${TEST}"
PROPERTIES
TIMEOUT 300
)
endforeach()
else()
add_test(NAME UnitTests
COMMAND "$<TARGET_FILE:rwtests>"
)
set_tests_properties(UnitTests
PROPERTIES
TIMEOUT 300
)
endif()
if(TEST_DATA)
add_test(NAME DataTests
COMMAND "$<TARGET_FILE:rwtests>" "--run_test=@data-test"
)
endif()