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
|
|
|
|
2021-10-27 18:30:26 +02:00
|
|
|
mwscript/test_scripts.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
|
2021-01-12 23:18:49 +01:00
|
|
|
lua/test_scriptscontainer.cpp
|
2021-01-12 23:17:48 +01:00
|
|
|
lua/test_utilpackage.cpp
|
2021-01-10 14:41:50 +01:00
|
|
|
lua/test_serialization.cpp
|
2021-10-06 20:59:48 +02:00
|
|
|
lua/test_configuration.cpp
|
2021-12-26 21:49:20 +01:00
|
|
|
lua/test_i18n.cpp
|
2021-12-14 00:39:01 +01:00
|
|
|
lua/test_storage.cpp
|
2021-01-12 23:17:48 +01:00
|
|
|
|
2021-11-18 15:19:54 +00:00
|
|
|
lua/test_ui_content.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
|
2021-11-10 23:06:35 +01:00
|
|
|
misc/test_resourcehelpers.cpp
|
2021-10-17 22:12:33 +02:00
|
|
|
misc/progressreporter.cpp
|
2021-10-18 01:43:33 +02:00
|
|
|
misc/compression.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
|
2021-06-29 03:49:21 +02:00
|
|
|
detournavigator/navmeshdb.cpp
|
|
|
|
detournavigator/serialization.cpp
|
2021-08-06 00:05:09 +02:00
|
|
|
detournavigator/asyncnavmeshupdater.cpp
|
2021-10-30 17:01:50 +02:00
|
|
|
|
|
|
|
serialization/binaryreader.cpp
|
|
|
|
serialization/binarywriter.cpp
|
|
|
|
serialization/sizeaccumulator.cpp
|
|
|
|
serialization/integration.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
|
2021-09-30 03:48:47 +02:00
|
|
|
|
|
|
|
../openmw/options.cpp
|
|
|
|
openmw/options.cpp
|
2021-10-16 13:03:15 +02:00
|
|
|
|
|
|
|
sqlite3/db.cpp
|
|
|
|
sqlite3/request.cpp
|
|
|
|
sqlite3/statement.cpp
|
|
|
|
sqlite3/transaction.cpp
|
2021-10-16 19:07:55 +02:00
|
|
|
|
|
|
|
esmloader/load.cpp
|
2021-10-20 16:28:18 +02:00
|
|
|
esmloader/esmdata.cpp
|
2021-11-15 17:40:22 +01:00
|
|
|
|
|
|
|
files/hash.cpp
|
2022-02-13 16:38:49 +01:00
|
|
|
|
|
|
|
toutf8/toutf8.cpp
|
2022-02-19 02:49:22 +01:00
|
|
|
|
|
|
|
esm4/includes.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-12-04 11:32:39 +00:00
|
|
|
target_link_libraries(openmw_test_suite ${GMOCK_LIBRARIES} components)
|
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
|
|
|
|
2021-10-21 19:48:31 +02: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 19:07:55 +02:00
|
|
|
)
|
|
|
|
|
2022-02-13 16:38:49 +01:00
|
|
|
target_compile_definitions(openmw_test_suite
|
|
|
|
PRIVATE OPENMW_DATA_DIR="${CMAKE_CURRENT_BINARY_DIR}/data"
|
|
|
|
OPENMW_TEST_SUITE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
2021-10-16 19:07:55 +02:00
|
|
|
|
2012-08-19 22:23:46 +03:00
|
|
|
endif()
|