mirror of https://github.com/OpenMW/openmw.git
Merge branch 'google_test_fetch_content' into 'master'
Use FetchContent to get googletest See merge request OpenMW/openmw!2240check_span
commit
77b82add49
@ -1,17 +0,0 @@
|
||||
#!/bin/sh -ex
|
||||
|
||||
git clone -b release-1.11.0 https://github.com/google/googletest.git
|
||||
cd googletest
|
||||
mkdir build
|
||||
cd build
|
||||
cmake \
|
||||
-D CMAKE_C_COMPILER="${CC}" \
|
||||
-D CMAKE_CXX_COMPILER="${CXX}" \
|
||||
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-D CMAKE_BUILD_TYPE="${CONFIGURATION}" \
|
||||
-D CMAKE_INSTALL_PREFIX="${GOOGLETEST_DIR}" \
|
||||
-G "${GENERATOR}" \
|
||||
..
|
||||
cmake --build . --config "${CONFIGURATION}" -- -j $(nproc)
|
||||
cmake --install . --config "${CONFIGURATION}"
|
@ -1,130 +1,130 @@
|
||||
find_package(GTest 1.10 REQUIRED)
|
||||
find_package(GMock 1.10 REQUIRED)
|
||||
if (OPENMW_USE_SYSTEM_GOOGLETEST)
|
||||
find_package(GTest 1.10 REQUIRED)
|
||||
find_package(GMock 1.10 REQUIRED)
|
||||
endif()
|
||||
|
||||
if (GTEST_FOUND AND GMOCK_FOUND)
|
||||
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${GMOCK_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${GMOCK_INCLUDE_DIRS})
|
||||
|
||||
file(GLOB UNITTEST_SRC_FILES
|
||||
testing_util.hpp
|
||||
file(GLOB UNITTEST_SRC_FILES
|
||||
testing_util.hpp
|
||||
|
||||
../openmw/mwworld/store.cpp
|
||||
../openmw/mwworld/esmstore.cpp
|
||||
mwworld/test_store.cpp
|
||||
../openmw/mwworld/store.cpp
|
||||
../openmw/mwworld/esmstore.cpp
|
||||
mwworld/test_store.cpp
|
||||
|
||||
mwdialogue/test_keywordsearch.cpp
|
||||
mwdialogue/test_keywordsearch.cpp
|
||||
|
||||
mwscript/test_scripts.cpp
|
||||
mwscript/test_scripts.cpp
|
||||
|
||||
esm/test_fixed_string.cpp
|
||||
esm/variant.cpp
|
||||
esm/test_fixed_string.cpp
|
||||
esm/variant.cpp
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
lua/test_ui_content.cpp
|
||||
lua/test_ui_content.cpp
|
||||
|
||||
misc/test_stringops.cpp
|
||||
misc/test_endianness.cpp
|
||||
misc/test_resourcehelpers.cpp
|
||||
misc/progressreporter.cpp
|
||||
misc/compression.cpp
|
||||
misc/test_stringops.cpp
|
||||
misc/test_endianness.cpp
|
||||
misc/test_resourcehelpers.cpp
|
||||
misc/progressreporter.cpp
|
||||
misc/compression.cpp
|
||||
|
||||
nifloader/testbulletnifloader.cpp
|
||||
nifloader/testbulletnifloader.cpp
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
serialization/binaryreader.cpp
|
||||
serialization/binarywriter.cpp
|
||||
serialization/sizeaccumulator.cpp
|
||||
serialization/integration.cpp
|
||||
serialization/binaryreader.cpp
|
||||
serialization/binarywriter.cpp
|
||||
serialization/sizeaccumulator.cpp
|
||||
serialization/integration.cpp
|
||||
|
||||
settings/parser.cpp
|
||||
settings/shadermanager.cpp
|
||||
settings/parser.cpp
|
||||
settings/shadermanager.cpp
|
||||
|
||||
shader/parsedefines.cpp
|
||||
shader/parsefors.cpp
|
||||
shader/parselinks.cpp
|
||||
shader/shadermanager.cpp
|
||||
shader/parsedefines.cpp
|
||||
shader/parsefors.cpp
|
||||
shader/parselinks.cpp
|
||||
shader/shadermanager.cpp
|
||||
|
||||
../openmw/options.cpp
|
||||
openmw/options.cpp
|
||||
../openmw/options.cpp
|
||||
openmw/options.cpp
|
||||
|
||||
sqlite3/db.cpp
|
||||
sqlite3/request.cpp
|
||||
sqlite3/statement.cpp
|
||||
sqlite3/transaction.cpp
|
||||
sqlite3/db.cpp
|
||||
sqlite3/request.cpp
|
||||
sqlite3/statement.cpp
|
||||
sqlite3/transaction.cpp
|
||||
|
||||
esmloader/load.cpp
|
||||
esmloader/esmdata.cpp
|
||||
esmloader/record.cpp
|
||||
esmloader/load.cpp
|
||||
esmloader/esmdata.cpp
|
||||
esmloader/record.cpp
|
||||
|
||||
files/hash.cpp
|
||||
files/hash.cpp
|
||||
|
||||
toutf8/toutf8.cpp
|
||||
toutf8/toutf8.cpp
|
||||
|
||||
esm4/includes.cpp
|
||||
esm4/includes.cpp
|
||||
|
||||
fx/lexer.cpp
|
||||
fx/technique.cpp
|
||||
fx/lexer.cpp
|
||||
fx/technique.cpp
|
||||
|
||||
esm3/readerscache.cpp
|
||||
)
|
||||
esm3/readerscache.cpp
|
||||
)
|
||||
|
||||
source_group(apps\\openmw_test_suite FILES openmw_test_suite.cpp ${UNITTEST_SRC_FILES})
|
||||
source_group(apps\\openmw_test_suite FILES openmw_test_suite.cpp ${UNITTEST_SRC_FILES})
|
||||
|
||||
openmw_add_executable(openmw_test_suite openmw_test_suite.cpp ${UNITTEST_SRC_FILES})
|
||||
openmw_add_executable(openmw_test_suite openmw_test_suite.cpp ${UNITTEST_SRC_FILES})
|
||||
|
||||
target_link_libraries(openmw_test_suite ${GMOCK_LIBRARIES} components)
|
||||
# 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()
|
||||
target_link_libraries(openmw_test_suite GTest::GTest GMock::GMock components)
|
||||
# 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()
|
||||
|
||||
if (BUILD_WITH_CODE_COVERAGE)
|
||||
add_definitions(--coverage)
|
||||
target_link_libraries(openmw_test_suite gcov)
|
||||
endif()
|
||||
if (BUILD_WITH_CODE_COVERAGE)
|
||||
add_definitions(--coverage)
|
||||
target_link_libraries(openmw_test_suite gcov)
|
||||
endif()
|
||||
|
||||
file(DOWNLOAD
|
||||
https://gitlab.com/OpenMW/example-suite/-/raw/8966dab24692555eec720c854fb0f73d108070cd/data/template.omwgame
|
||||
${CMAKE_CURRENT_BINARY_DIR}/data/template.omwgame
|
||||
EXPECTED_HASH SHA512=6e38642bcf013c5f496a9cb0bf3ec7c9553b6e86b836e7844824c5a05f556c9391167214469b6318401684b702d7569896bf743c85aee4198612b3315ba778d6
|
||||
)
|
||||
file(DOWNLOAD
|
||||
https://gitlab.com/OpenMW/example-suite/-/raw/8966dab24692555eec720c854fb0f73d108070cd/data/template.omwgame
|
||||
${CMAKE_CURRENT_BINARY_DIR}/data/template.omwgame
|
||||
EXPECTED_HASH SHA512=6e38642bcf013c5f496a9cb0bf3ec7c9553b6e86b836e7844824c5a05f556c9391167214469b6318401684b702d7569896bf743c85aee4198612b3315ba778d6
|
||||
)
|
||||
|
||||
target_compile_definitions(openmw_test_suite
|
||||
PRIVATE OPENMW_DATA_DIR="${CMAKE_CURRENT_BINARY_DIR}/data"
|
||||
OPENMW_TEST_SUITE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
target_compile_definitions(openmw_test_suite
|
||||
PRIVATE OPENMW_DATA_DIR="${CMAKE_CURRENT_BINARY_DIR}/data"
|
||||
OPENMW_TEST_SUITE_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
|
||||
target_precompile_headers(openmw_test_suite PRIVATE
|
||||
<boost/program_options/options_description.hpp>
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
|
||||
target_precompile_headers(openmw_test_suite PRIVATE
|
||||
<boost/program_options/options_description.hpp>
|
||||
|
||||
<gtest/gtest.h>
|
||||
<gtest/gtest.h>
|
||||
|
||||
<sol/sol.hpp>
|
||||
<sol/sol.hpp>
|
||||
|
||||
<algorithm>
|
||||
<filesystem>
|
||||
<fstream>
|
||||
<functional>
|
||||
<memory>
|
||||
<string>
|
||||
<vector>
|
||||
)
|
||||
endif()
|
||||
<algorithm>
|
||||
<filesystem>
|
||||
<fstream>
|
||||
<functional>
|
||||
<memory>
|
||||
<string>
|
||||
<vector>
|
||||
)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue