2022-08-04 00:12:29 +02:00
|
|
|
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
|
|
|
|
include_directories(SYSTEM ${GMOCK_INCLUDE_DIRS})
|
2012-08-19 22:23:46 +03:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
file(GLOB UNITTEST_SRC_FILES
|
2024-06-09 13:51:15 +02:00
|
|
|
main.cpp
|
2021-10-27 18:30:26 +02:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
esm/test_fixed_string.cpp
|
|
|
|
esm/variant.cpp
|
2023-03-03 13:53:50 +01:00
|
|
|
esm/testrefid.cpp
|
2017-05-07 23:28:56 +02:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
lua/test_lua.cpp
|
|
|
|
lua/test_scriptscontainer.cpp
|
|
|
|
lua/test_utilpackage.cpp
|
|
|
|
lua/test_serialization.cpp
|
|
|
|
lua/test_configuration.cpp
|
|
|
|
lua/test_l10n.cpp
|
|
|
|
lua/test_storage.cpp
|
2022-10-17 17:53:13 +02:00
|
|
|
lua/test_async.cpp
|
2023-12-29 18:56:59 +00:00
|
|
|
lua/test_inputactions.cpp
|
2024-03-05 10:07:35 +04:00
|
|
|
lua/test_yaml.cpp
|
2021-01-12 23:17:48 +01:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
lua/test_ui_content.cpp
|
2021-11-18 15:19:54 +00:00
|
|
|
|
2024-06-22 03:47:00 +02:00
|
|
|
misc/compression.cpp
|
|
|
|
misc/progressreporter.cpp
|
2022-08-04 00:12:29 +02:00
|
|
|
misc/test_endianness.cpp
|
|
|
|
misc/test_resourcehelpers.cpp
|
2024-06-22 03:47:00 +02:00
|
|
|
misc/test_stringops.cpp
|
|
|
|
misc/testmathutil.cpp
|
2018-07-08 22:22:34 +03:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
nifloader/testbulletnifloader.cpp
|
2018-03-14 01:49:08 +03:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
detournavigator/navigator.cpp
|
|
|
|
detournavigator/settingsutils.cpp
|
|
|
|
detournavigator/recastmeshbuilder.cpp
|
|
|
|
detournavigator/gettilespositions.cpp
|
|
|
|
detournavigator/recastmeshobject.cpp
|
|
|
|
detournavigator/navmeshtilescache.cpp
|
|
|
|
detournavigator/tilecachedrecastmeshmanager.cpp
|
|
|
|
detournavigator/navmeshdb.cpp
|
|
|
|
detournavigator/serialization.cpp
|
|
|
|
detournavigator/asyncnavmeshupdater.cpp
|
2021-10-30 17:01:50 +02:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
serialization/binaryreader.cpp
|
|
|
|
serialization/binarywriter.cpp
|
|
|
|
serialization/sizeaccumulator.cpp
|
|
|
|
serialization/integration.cpp
|
2019-09-29 17:42:01 +02:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
settings/parser.cpp
|
|
|
|
settings/shadermanager.cpp
|
2023-04-23 15:15:33 +02:00
|
|
|
settings/testvalues.cpp
|
2020-05-01 23:03:13 +02:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
shader/parsedefines.cpp
|
|
|
|
shader/parsefors.cpp
|
|
|
|
shader/parselinks.cpp
|
|
|
|
shader/shadermanager.cpp
|
2021-09-30 03:48:47 +02:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
sqlite3/db.cpp
|
|
|
|
sqlite3/request.cpp
|
|
|
|
sqlite3/statement.cpp
|
|
|
|
sqlite3/transaction.cpp
|
2021-10-16 19:07:55 +02:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
esmloader/load.cpp
|
|
|
|
esmloader/esmdata.cpp
|
|
|
|
esmloader/record.cpp
|
2021-11-15 17:40:22 +01:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
files/hash.cpp
|
2022-07-12 20:47:15 +02:00
|
|
|
files/conversion_tests.cpp
|
2022-02-13 16:38:49 +01:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
toutf8/toutf8.cpp
|
2022-02-19 02:49:22 +01:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
esm4/includes.cpp
|
2022-05-13 18:58:00 -07:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
fx/lexer.cpp
|
|
|
|
fx/technique.cpp
|
2022-06-01 22:53:18 +02:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
esm3/readerscache.cpp
|
2023-02-11 13:30:28 +01:00
|
|
|
esm3/testsaveload.cpp
|
2023-02-11 00:01:59 +01:00
|
|
|
esm3/testesmwriter.cpp
|
2023-07-30 13:17:19 +02:00
|
|
|
esm3/testinfoorder.cpp
|
2024-10-06 11:32:24 +02:00
|
|
|
esm3/testcstringids.cpp
|
2022-09-18 15:00:02 +02:00
|
|
|
|
|
|
|
nifosg/testnifloader.cpp
|
2023-08-05 03:04:34 +02:00
|
|
|
|
|
|
|
esmterrain/testgridsampling.cpp
|
2023-12-16 00:28:47 +01:00
|
|
|
|
|
|
|
resource/testobjectcache.cpp
|
2024-02-03 14:09:50 +01:00
|
|
|
|
|
|
|
vfs/testpathutil.cpp
|
2024-04-17 08:16:48 +01:00
|
|
|
|
|
|
|
sceneutil/osgacontroller.cpp
|
2022-08-04 00:12:29 +02:00
|
|
|
)
|
2012-08-19 22:23:46 +03:00
|
|
|
|
2024-06-09 13:51:15 +02:00
|
|
|
source_group(apps\\components-tests FILES ${UNITTEST_SRC_FILES})
|
|
|
|
|
|
|
|
openmw_add_executable(components-tests ${UNITTEST_SRC_FILES})
|
2012-08-19 22:23:46 +03:00
|
|
|
|
2024-06-09 13:51:15 +02:00
|
|
|
target_link_libraries(components-tests
|
|
|
|
GTest::GTest
|
|
|
|
GMock::GMock
|
|
|
|
components
|
|
|
|
)
|
2012-08-19 22:23:46 +03:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
# Fix for not visible pthreads functions for linker with glibc 2.15
|
|
|
|
if (UNIX AND NOT APPLE)
|
2024-06-09 13:51:15 +02:00
|
|
|
target_link_libraries(components-tests ${CMAKE_THREAD_LIBS_INIT})
|
2022-08-04 00:12:29 +02:00
|
|
|
endif()
|
2018-07-08 20:27:46 +03:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
if (BUILD_WITH_CODE_COVERAGE)
|
2024-06-09 13:51:15 +02:00
|
|
|
target_compile_options(components-tests PRIVATE --coverage)
|
|
|
|
target_link_libraries(components-tests gcov)
|
2022-08-04 00:12:29 +02:00
|
|
|
endif()
|
2019-01-20 14:36:48 +01:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
file(DOWNLOAD
|
|
|
|
https://gitlab.com/OpenMW/example-suite/-/raw/8966dab24692555eec720c854fb0f73d108070cd/data/template.omwgame
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/data/template.omwgame
|
|
|
|
EXPECTED_HASH SHA512=6e38642bcf013c5f496a9cb0bf3ec7c9553b6e86b836e7844824c5a05f556c9391167214469b6318401684b702d7569896bf743c85aee4198612b3315ba778d6
|
|
|
|
)
|
2021-10-16 19:07:55 +02:00
|
|
|
|
2024-06-09 13:51:15 +02:00
|
|
|
target_compile_definitions(components-tests
|
2022-09-14 21:45:18 +02:00
|
|
|
PRIVATE OPENMW_DATA_DIR=u8"${CMAKE_CURRENT_BINARY_DIR}/data"
|
2023-04-23 14:46:30 +02:00
|
|
|
OPENMW_PROJECT_SOURCE_DIR=u8"${PROJECT_SOURCE_DIR}")
|
2021-10-16 19:07:55 +02:00
|
|
|
|
2024-03-08 01:22:42 +01:00
|
|
|
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
|
2024-06-09 13:51:15 +02:00
|
|
|
target_precompile_headers(components-tests PRIVATE
|
2022-08-04 00:12:29 +02:00
|
|
|
<boost/program_options/options_description.hpp>
|
2022-07-01 14:05:17 +00:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
<gtest/gtest.h>
|
2022-07-01 14:05:17 +00:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
<sol/sol.hpp>
|
2022-07-01 14:05:17 +00:00
|
|
|
|
2022-08-04 00:12:29 +02:00
|
|
|
<algorithm>
|
|
|
|
<filesystem>
|
|
|
|
<fstream>
|
|
|
|
<functional>
|
|
|
|
<memory>
|
|
|
|
<string>
|
|
|
|
<vector>
|
|
|
|
)
|
2012-08-19 22:23:46 +03:00
|
|
|
endif()
|