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-10-06 18:59:48 +00:00
|
|
|
lua/test_configuration.cpp
|
2022-04-10 07:57:02 +00:00
|
|
|
lua/test_l10n.cpp
|
2021-12-13 23:39:01 +00:00
|
|
|
lua/test_storage.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-06-29 01:49:21 +00:00
|
|
|
detournavigator/navmeshdb.cpp
|
|
|
|
detournavigator/serialization.cpp
|
2021-08-05 22:05:09 +00:00
|
|
|
detournavigator/asyncnavmeshupdater.cpp
|
2021-10-30 15:01:50 +00:00
|
|
|
|
|
|
|
serialization/binaryreader.cpp
|
|
|
|
serialization/binarywriter.cpp
|
|
|
|
serialization/sizeaccumulator.cpp
|
|
|
|
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
|
2022-04-26 17:54:24 +00:00
|
|
|
shader/parselinks.cpp
|
2020-05-01 21:03:13 +00:00
|
|
|
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
|
2022-04-12 15:27:59 +00:00
|
|
|
esmloader/record.cpp
|
2021-11-15 16:40:22 +00:00
|
|
|
|
|
|
|
files/hash.cpp
|
2022-02-13 15:38:49 +00:00
|
|
|
|
|
|
|
toutf8/toutf8.cpp
|
2022-02-19 01:49:22 +00:00
|
|
|
|
|
|
|
esm4/includes.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-12-04 11:32:39 +00:00
|
|
|
target_link_libraries(openmw_test_suite ${GMOCK_LIBRARIES} components)
|
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
|
|
|
|
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
|
2022-04-04 03:46:39 +00:00
|
|
|
EXPECTED_HASH SHA512=6e38642bcf013c5f496a9cb0bf3ec7c9553b6e86b836e7844824c5a05f556c9391167214469b6318401684b702d7569896bf743c85aee4198612b3315ba778d6
|
2021-10-16 17:07:55 +00:00
|
|
|
)
|
|
|
|
|
2022-02-13 15:38:49 +00: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 17:07:55 +00:00
|
|
|
|
2012-08-19 19:23:46 +00:00
|
|
|
endif()
|