2017-10-27 05:41:19 +02:00
|
|
|
set(TESTS
|
|
|
|
Animation
|
|
|
|
Archive
|
|
|
|
Buoyancy
|
|
|
|
Character
|
|
|
|
Chase
|
|
|
|
Config
|
|
|
|
Cutscene
|
|
|
|
Data
|
|
|
|
FileIndex
|
|
|
|
GameData
|
|
|
|
GameWorld
|
2018-05-31 22:38:47 +02:00
|
|
|
Garage
|
2017-10-27 05:41:19 +02:00
|
|
|
Input
|
|
|
|
Items
|
|
|
|
Lifetime
|
|
|
|
LoaderDFF
|
2018-08-06 01:03:32 +02:00
|
|
|
LoaderIDE
|
2017-10-27 05:41:19 +02:00
|
|
|
LoaderIPL
|
|
|
|
Logger
|
|
|
|
Menu
|
|
|
|
Object
|
2018-06-18 06:24:34 +02:00
|
|
|
Payphone
|
2017-10-27 05:41:19 +02:00
|
|
|
Pickup
|
|
|
|
Renderer
|
|
|
|
RWBStream
|
|
|
|
SaveGame
|
|
|
|
ScriptMachine
|
|
|
|
State
|
2017-09-07 18:44:21 +02:00
|
|
|
StringEncoding
|
2018-08-22 23:01:25 +02:00
|
|
|
Sound
|
2017-10-27 05:41:19 +02:00
|
|
|
Text
|
|
|
|
TrafficDirector
|
|
|
|
Vehicle
|
|
|
|
VisualFX
|
|
|
|
Weapon
|
|
|
|
World
|
|
|
|
ZoneData
|
|
|
|
)
|
|
|
|
|
2016-04-15 02:06:10 +02:00
|
|
|
set(TEST_SOURCES
|
2017-10-26 01:03:15 +02:00
|
|
|
main.cpp
|
2017-10-26 03:51:24 +02:00
|
|
|
test_Globals.cpp
|
|
|
|
test_Globals.hpp
|
2016-05-20 03:09:22 +02:00
|
|
|
|
2017-10-26 01:03:15 +02:00
|
|
|
# Hack in rwgame sources until there's a per-target test suite
|
2018-06-24 00:43:06 +02:00
|
|
|
"${PROJECT_SOURCE_DIR}/rwgame/GameConfig.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/rwgame/GameWindow.cpp"
|
|
|
|
"${PROJECT_SOURCE_DIR}/rwgame/GameInput.cpp"
|
2017-10-26 01:03:15 +02:00
|
|
|
)
|
2013-09-11 13:10:42 +02:00
|
|
|
|
2017-10-27 05:41:19 +02:00
|
|
|
foreach(TEST ${TESTS})
|
|
|
|
list(APPEND TEST_SOURCES "test_${TEST}.cpp")
|
|
|
|
endforeach()
|
|
|
|
|
2017-11-05 02:32:08 +01:00
|
|
|
add_executable(rwtests
|
2017-10-27 05:41:19 +02:00
|
|
|
${TEST_SOURCES}
|
|
|
|
)
|
2013-09-11 13:10:42 +02:00
|
|
|
|
2017-11-05 02:32:08 +01:00
|
|
|
target_compile_definitions(rwtests
|
2017-10-26 00:44:45 +02:00
|
|
|
PRIVATE
|
|
|
|
"RW_TEST_WITH_DATA=$<NOT:$<BOOL:${TESTS_NODATA}>>"
|
|
|
|
)
|
2013-09-11 13:10:42 +02:00
|
|
|
|
2017-11-05 02:32:08 +01:00
|
|
|
target_include_directories(rwtests
|
2017-10-26 00:44:45 +02:00
|
|
|
PRIVATE
|
2018-06-24 00:43:06 +02:00
|
|
|
"${PROJECT_SOURCE_DIR}/tests"
|
|
|
|
"${PROJECT_SOURCE_DIR}/rwgame"
|
2017-10-26 00:44:45 +02:00
|
|
|
)
|
2013-09-11 13:10:42 +02:00
|
|
|
|
2017-11-05 02:32:08 +01: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
|
2017-10-26 01:03:15 +02:00
|
|
|
rwengine
|
2018-06-24 00:43:06 +02:00
|
|
|
SDL2::SDL2
|
|
|
|
Boost::filesystem
|
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
|
|
|
|
INSTALL INSTALL_PDB
|
|
|
|
)
|
2017-10-29 07:37:18 +01:00
|
|
|
|
2017-11-03 23:59:02 +01:00
|
|
|
if(SEPARATE_TEST_SUITES)
|
2017-10-27 05:41:19 +02:00
|
|
|
foreach(TEST ${TESTS})
|
|
|
|
add_test(
|
|
|
|
NAME "${TEST}"
|
2017-11-05 02:32:08 +01:00
|
|
|
COMMAND "$<TARGET_FILE:rwtests>" "-t" "${TEST}Tests"
|
2017-10-27 05:41:19 +02:00
|
|
|
)
|
|
|
|
set_tests_properties("${TEST}"
|
|
|
|
PROPERTIES
|
2017-10-28 17:20:48 +02:00
|
|
|
TIMEOUT 300
|
2017-10-27 05:41:19 +02:00
|
|
|
)
|
|
|
|
endforeach()
|
|
|
|
else()
|
|
|
|
add_test(NAME UnitTests
|
2017-11-05 02:32:08 +01:00
|
|
|
COMMAND "$<TARGET_FILE:rwtests>"
|
2017-10-27 05:41:19 +02:00
|
|
|
)
|
|
|
|
set_tests_properties(UnitTests
|
|
|
|
PROPERTIES
|
2017-10-28 17:02:20 +02:00
|
|
|
TIMEOUT 300
|
2017-10-27 05:41:19 +02:00
|
|
|
)
|
|
|
|
endif()
|