2020-12-07 19:09:58 +04:00
|
|
|
find_package(GTest 1.10 REQUIRED)
|
|
|
|
find_package(GMock 1.10 REQUIRED)
|
2012-08-19 22:23:46 +03:00
|
|
|
|
2018-07-08 20:26:57 +03:00
|
|
|
if (GTEST_FOUND AND GMOCK_FOUND)
|
2017-08-20 22:30:10 +03:00
|
|
|
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
|
2018-07-08 20:26:57 +03:00
|
|
|
include_directories(SYSTEM ${GMOCK_INCLUDE_DIRS})
|
2012-08-19 22:23:46 +03:00
|
|
|
|
|
|
|
file(GLOB UNITTEST_SRC_FILES
|
2015-11-13 23:12:07 +01:00
|
|
|
../openmw/mwworld/store.cpp
|
|
|
|
../openmw/mwworld/esmstore.cpp
|
|
|
|
mwworld/test_store.cpp
|
|
|
|
|
2015-11-13 20:27:06 +01:00
|
|
|
mwdialogue/test_keywordsearch.cpp
|
2016-05-07 22:23:53 +03:00
|
|
|
|
|
|
|
esm/test_fixed_string.cpp
|
2021-04-04 20:15:58 +02:00
|
|
|
esm/variant.cpp
|
2017-05-07 23:28:56 +02:00
|
|
|
|
2021-01-12 23:17:48 +01:00
|
|
|
lua/test_lua.cpp
|
|
|
|
lua/test_utilpackage.cpp
|
|
|
|
|
2017-05-07 23:28:56 +02:00
|
|
|
misc/test_stringops.cpp
|
2021-02-09 13:09:36 -05:00
|
|
|
misc/test_endianness.cpp
|
2018-07-08 22:22:34 +03:00
|
|
|
|
|
|
|
nifloader/testbulletnifloader.cpp
|
2018-03-14 01:49:08 +03:00
|
|
|
|
|
|
|
detournavigator/navigator.cpp
|
|
|
|
detournavigator/settingsutils.cpp
|
|
|
|
detournavigator/recastmeshbuilder.cpp
|
2018-04-15 22:54:45 +03:00
|
|
|
detournavigator/gettilespositions.cpp
|
2018-05-26 17:44:25 +03:00
|
|
|
detournavigator/recastmeshobject.cpp
|
2018-10-01 01:33:25 +03:00
|
|
|
detournavigator/navmeshtilescache.cpp
|
2019-02-17 00:48:07 +03:00
|
|
|
detournavigator/tilecachedrecastmeshmanager.cpp
|
2019-09-29 17:42:01 +02:00
|
|
|
|
|
|
|
settings/parser.cpp
|
2020-05-01 23:03:13 +02:00
|
|
|
|
|
|
|
shader/parsedefines.cpp
|
|
|
|
shader/parsefors.cpp
|
|
|
|
shader/shadermanager.cpp
|
2012-08-19 22:23:46 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
source_group(apps\\openmw_test_suite FILES openmw_test_suite.cpp ${UNITTEST_SRC_FILES})
|
|
|
|
|
2017-09-08 22:17:42 +01:00
|
|
|
openmw_add_executable(openmw_test_suite openmw_test_suite.cpp ${UNITTEST_SRC_FILES})
|
2012-08-19 22:23:46 +03:00
|
|
|
|
2021-01-12 23:17:48 +01:00
|
|
|
target_link_libraries(openmw_test_suite ${GMOCK_LIBRARIES} components ${LUA_LIBRARIES})
|
2012-08-20 00:18:40 +03:00
|
|
|
# Fix for not visible pthreads functions for linker with glibc 2.15
|
|
|
|
if (UNIX AND NOT APPLE)
|
|
|
|
target_link_libraries(openmw_test_suite ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
endif()
|
2018-07-08 20:27:46 +03:00
|
|
|
|
|
|
|
if (BUILD_WITH_CODE_COVERAGE)
|
|
|
|
add_definitions(--coverage)
|
|
|
|
target_link_libraries(openmw_test_suite gcov)
|
|
|
|
endif()
|
2019-01-20 14:36:48 +01:00
|
|
|
|
|
|
|
if (MSVC)
|
2019-01-21 20:58:24 +01:00
|
|
|
if (CMAKE_CL_64)
|
|
|
|
# Debug version of openmw_unit_tests needs increased number of sections beyond 2^16
|
|
|
|
# just like openmw and openmw-cs
|
|
|
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /bigobj")
|
|
|
|
endif (CMAKE_CL_64)
|
2019-01-20 14:36:48 +01:00
|
|
|
endif (MSVC)
|
|
|
|
|
2012-08-19 22:23:46 +03:00
|
|
|
endif()
|