2020-12-07 15:09:58 +00:00
|
|
|
find_package(GTest 1.10 REQUIRED)
|
|
|
|
find_package(GMock 1.10 REQUIRED)
|
2012-08-19 19:23:46 +00:00
|
|
|
|
2018-07-08 17:26:57 +00:00
|
|
|
if (GTEST_FOUND AND GMOCK_FOUND)
|
2017-08-20 19:30:10 +00:00
|
|
|
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
|
2018-07-08 17:26:57 +00:00
|
|
|
include_directories(SYSTEM ${GMOCK_INCLUDE_DIRS})
|
2012-08-19 19:23:46 +00:00
|
|
|
|
|
|
|
file(GLOB UNITTEST_SRC_FILES
|
2015-11-13 22:12:07 +00:00
|
|
|
../openmw/mwworld/store.cpp
|
|
|
|
../openmw/mwworld/esmstore.cpp
|
|
|
|
mwworld/test_store.cpp
|
|
|
|
|
2015-11-13 19:27:06 +00:00
|
|
|
mwdialogue/test_keywordsearch.cpp
|
2016-05-07 19:23:53 +00:00
|
|
|
|
2021-10-27 16:30:26 +00:00
|
|
|
mwscript/test_scripts.cpp
|
|
|
|
|
2016-05-07 19:23:53 +00:00
|
|
|
esm/test_fixed_string.cpp
|
2021-04-04 18:15:58 +00:00
|
|
|
esm/variant.cpp
|
2017-05-07 21:28:56 +00:00
|
|
|
|
2021-01-12 22:17:48 +00:00
|
|
|
lua/test_lua.cpp
|
2021-01-12 22:18:49 +00:00
|
|
|
lua/test_scriptscontainer.cpp
|
2021-01-12 22:17:48 +00:00
|
|
|
lua/test_utilpackage.cpp
|
2021-01-10 13:41:50 +00:00
|
|
|
lua/test_serialization.cpp
|
2021-04-26 21:20:16 +00:00
|
|
|
lua/test_querypackage.cpp
|
2021-10-06 18:59:48 +00:00
|
|
|
lua/test_configuration.cpp
|
2021-01-12 22:17:48 +00:00
|
|
|
|
2021-11-18 15:19:54 +00:00
|
|
|
lua/test_ui_content.cpp
|
|
|
|
|
2017-05-07 21:28:56 +00:00
|
|
|
misc/test_stringops.cpp
|
2021-02-09 18:09:36 +00:00
|
|
|
misc/test_endianness.cpp
|
2021-11-10 22:06:35 +00:00
|
|
|
misc/test_resourcehelpers.cpp
|
2021-10-17 20:12:33 +00:00
|
|
|
misc/progressreporter.cpp
|
2021-10-17 23:43:33 +00:00
|
|
|
misc/compression.cpp
|
2018-07-08 19:22:34 +00:00
|
|
|
|
|
|
|
nifloader/testbulletnifloader.cpp
|
2018-03-13 22:49:08 +00:00
|
|
|
|
|
|
|
detournavigator/navigator.cpp
|
|
|
|
detournavigator/settingsutils.cpp
|
|
|
|
detournavigator/recastmeshbuilder.cpp
|
2018-04-15 19:54:45 +00:00
|
|
|
detournavigator/gettilespositions.cpp
|
2018-05-26 14:44:25 +00:00
|
|
|
detournavigator/recastmeshobject.cpp
|
2018-09-30 22:33:25 +00:00
|
|
|
detournavigator/navmeshtilescache.cpp
|
2019-02-16 21:48:07 +00:00
|
|
|
detournavigator/tilecachedrecastmeshmanager.cpp
|
2021-10-22 22:06:10 +00:00
|
|
|
detournavigator/serialization/binaryreader.cpp
|
|
|
|
detournavigator/serialization/binarywriter.cpp
|
|
|
|
detournavigator/serialization/sizeaccumulator.cpp
|
|
|
|
detournavigator/serialization/integration.cpp
|
2019-09-29 15:42:01 +00:00
|
|
|
|
|
|
|
settings/parser.cpp
|
2020-05-01 21:03:13 +00:00
|
|
|
|
|
|
|
shader/parsedefines.cpp
|
|
|
|
shader/parsefors.cpp
|
|
|
|
shader/shadermanager.cpp
|
2021-09-30 01:48:47 +00:00
|
|
|
|
|
|
|
../openmw/options.cpp
|
|
|
|
openmw/options.cpp
|
2021-10-16 11:03:15 +00:00
|
|
|
|
|
|
|
sqlite3/db.cpp
|
|
|
|
sqlite3/request.cpp
|
|
|
|
sqlite3/statement.cpp
|
|
|
|
sqlite3/transaction.cpp
|
2021-10-16 17:07:55 +00:00
|
|
|
|
|
|
|
esmloader/load.cpp
|
2021-10-20 14:28:18 +00:00
|
|
|
esmloader/esmdata.cpp
|
2012-08-19 19:23:46 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
source_group(apps\\openmw_test_suite FILES openmw_test_suite.cpp ${UNITTEST_SRC_FILES})
|
|
|
|
|
2017-09-08 21:17:42 +00:00
|
|
|
openmw_add_executable(openmw_test_suite openmw_test_suite.cpp ${UNITTEST_SRC_FILES})
|
2012-08-19 19:23:46 +00:00
|
|
|
|
2021-01-12 22:17:48 +00:00
|
|
|
target_link_libraries(openmw_test_suite ${GMOCK_LIBRARIES} components ${LUA_LIBRARIES})
|
2012-08-19 21:18:40 +00: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 17:27:46 +00:00
|
|
|
|
|
|
|
if (BUILD_WITH_CODE_COVERAGE)
|
|
|
|
add_definitions(--coverage)
|
|
|
|
target_link_libraries(openmw_test_suite gcov)
|
|
|
|
endif()
|
2019-01-20 13:36:48 +00:00
|
|
|
|
|
|
|
if (MSVC)
|
2019-01-21 19:58:24 +00: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 13:36:48 +00:00
|
|
|
endif (MSVC)
|
|
|
|
|
2021-10-21 17:48:31 +00:00
|
|
|
file(DOWNLOAD
|
|
|
|
https://gitlab.com/OpenMW/example-suite/-/raw/8966dab24692555eec720c854fb0f73d108070cd/data/template.omwgame
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/data/template.omwgame
|
|
|
|
EXPECTED_MD5 bf3691034a38611534c74c3b89a7d2c3
|
2021-10-16 17:07:55 +00:00
|
|
|
)
|
|
|
|
|
2021-10-21 17:48:31 +00:00
|
|
|
target_compile_definitions(openmw_test_suite PRIVATE OPENMW_DATA_DIR="${CMAKE_CURRENT_BINARY_DIR}/data")
|
2021-10-16 17:07:55 +00:00
|
|
|
|
2012-08-19 19:23:46 +00:00
|
|
|
endif()
|