2020-07-11 10:16:20 +00:00
|
|
|
# Test files
|
2013-03-19 22:07:39 +00:00
|
|
|
|
2020-07-11 10:16:20 +00:00
|
|
|
set(TEST_FILES
|
|
|
|
common/colobot.ini
|
|
|
|
)
|
|
|
|
|
|
|
|
file(COPY ${TEST_FILES} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
|
|
|
|
|
|
|
# Targets
|
|
|
|
|
|
|
|
add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
|
|
|
|
|
|
|
|
add_executable(colobot_ut
|
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
|
2013-02-03 19:03:36 +00:00
|
|
|
)
|
|
|
|
|
2020-07-11 10:16:20 +00:00
|
|
|
# Platform-dependent tests
|
|
|
|
if(PLATFORM_WINDOWS)
|
|
|
|
target_sources(colobot_ut PRIVATE common/system/system_windows_test.cpp)
|
|
|
|
elseif(PLATFORM_LINUX)
|
|
|
|
target_sources(colobot_ut PRIVATE common/system/system_linux_test.cpp)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
target_include_directories(colobot_ut PRIVATE
|
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
|
|
|
)
|
|
|
|
|
2020-07-11 10:16:20 +00:00
|
|
|
target_link_libraries(colobot_ut PRIVATE GTest::GTest hippomocks colobotbase)
|
2014-08-12 18:03:56 +00:00
|
|
|
|
2020-07-11 10:16:20 +00:00
|
|
|
gtest_discover_tests(colobot_ut
|
|
|
|
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
2018-05-09 07:49:23 +00:00
|
|
|
|
|
|
|
# GoogleTest isn't compatible with -Wsuggest-override -Werror:
|
|
|
|
# see https://github.com/google/googletest/issues/1063
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
|
|
|
target_compile_options(colobot_ut PRIVATE "-Wno-suggest-override")
|
|
|
|
endif()
|