2013-03-19 22:07:39 +00:00
|
|
|
# Platform-dependent tests
|
2013-06-24 11:28:18 +00:00
|
|
|
if(PLATFORM_WINDOWS)
|
2016-07-24 12:38:49 +00:00
|
|
|
set(PLATFORM_TESTS common/system/system_windows_test.cpp)
|
2013-06-24 11:28:18 +00:00
|
|
|
elseif(PLATFORM_LINUX)
|
2016-07-24 12:38:49 +00:00
|
|
|
set(PLATFORM_TESTS common/system/system_linux_test.cpp)
|
2013-03-19 22:07:39 +00:00
|
|
|
endif()
|
|
|
|
|
2014-08-12 18:03:56 +00:00
|
|
|
# Sources
|
2013-02-03 19:03:36 +00:00
|
|
|
set(UT_SOURCES
|
2014-08-12 18:03:56 +00:00
|
|
|
main.cpp
|
|
|
|
app/app_test.cpp
|
2015-12-23 17:44:14 +00:00
|
|
|
CBot/CBotToken_test.cpp
|
2016-01-23 19:58:03 +00:00
|
|
|
CBot/CBot_test.cpp
|
2015-07-19 13:30:30 +00:00
|
|
|
common/config_file_test.cpp
|
2014-08-12 18:03:56 +00:00
|
|
|
graphics/engine/lightman_test.cpp
|
|
|
|
math/func_test.cpp
|
|
|
|
math/geometry_test.cpp
|
|
|
|
math/matrix_test.cpp
|
|
|
|
math/vector_test.cpp
|
|
|
|
${PLATFORM_TESTS}
|
2013-02-03 19:03:36 +00:00
|
|
|
)
|
|
|
|
|
2014-08-12 18:03:56 +00:00
|
|
|
# Includes
|
2013-02-25 20:58:01 +00:00
|
|
|
include_directories(
|
2014-08-12 18:03:56 +00:00
|
|
|
common
|
|
|
|
math
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
${COLOBOT_LOCAL_INCLUDES}
|
2013-03-22 17:19:53 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
include_directories(
|
2014-08-12 18:03:56 +00:00
|
|
|
SYSTEM
|
|
|
|
${GTEST_INCLUDE_DIR}
|
2015-05-12 22:52:18 +00:00
|
|
|
${HIPPOMOCKS_INCLUDE_DIR}
|
2014-08-12 18:03:56 +00:00
|
|
|
${COLOBOT_SYSTEM_INCLUDES}
|
2013-02-25 20:58:01 +00:00
|
|
|
)
|
|
|
|
|
2014-08-12 18:03:56 +00:00
|
|
|
# Libraries
|
2013-02-25 20:58:01 +00:00
|
|
|
set(LIBS
|
2014-08-12 18:03:56 +00:00
|
|
|
gtest
|
|
|
|
colobotbase
|
|
|
|
${COLOBOT_LIBS}
|
2013-02-25 20:58:01 +00:00
|
|
|
)
|
|
|
|
|
2014-08-12 18:03:56 +00:00
|
|
|
# Test files
|
2013-02-03 19:03:36 +00:00
|
|
|
|
2014-08-12 18:03:56 +00:00
|
|
|
set(TEST_FILES
|
|
|
|
common/colobot.ini
|
|
|
|
)
|
2013-02-03 19:03:36 +00:00
|
|
|
|
2014-08-12 18:03:56 +00:00
|
|
|
file(COPY ${TEST_FILES} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
|
|
|
|
|
|
|
# Targets
|
|
|
|
|
2015-08-14 11:59:05 +00:00
|
|
|
add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
|
|
|
|
|
2014-08-12 18:03:56 +00:00
|
|
|
add_executable(colobot_ut ${UT_SOURCES})
|
|
|
|
target_link_libraries(colobot_ut ${LIBS})
|
|
|
|
|
|
|
|
add_test(
|
|
|
|
NAME colobot_ut
|
|
|
|
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/colobot_ut
|
|
|
|
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
|
|
|
)
|