mirror of https://github.com/OpenMW/openmw.git
Split openmw_test_suite into openmw and components tests
To avoid duplicated compilation for openmw translation units. Link openmw-lib to openmw-tests instead.pull/3236/head
parent
9b0362fba8
commit
7d1cd11ba9
@ -1,12 +1,11 @@
|
||||
#include "gmock/gmock.h"
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <components/files/configurationmanager.hpp>
|
||||
#include <components/fx/technique.hpp>
|
||||
#include <components/resource/imagemanager.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
|
||||
#include "../testing_util.hpp"
|
||||
#include <components/testing/util.hpp>
|
||||
|
||||
namespace
|
||||
{
|
@ -1,10 +1,9 @@
|
||||
#include "gmock/gmock.h"
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <components/lua/asyncpackage.hpp>
|
||||
#include <components/lua/luastate.hpp>
|
||||
|
||||
#include "../testing_util.hpp"
|
||||
#include <components/testing/util.hpp>
|
||||
|
||||
namespace
|
||||
{
|
@ -1,10 +1,9 @@
|
||||
#include "gmock/gmock.h"
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <components/lua/inputactions.hpp>
|
||||
#include <components/lua/scriptscontainer.hpp>
|
||||
|
||||
#include "../testing_util.hpp"
|
||||
#include <components/testing/util.hpp>
|
||||
|
||||
namespace
|
||||
{
|
@ -1,13 +1,11 @@
|
||||
#include "gmock/gmock.h"
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <components/files/fixedpath.hpp>
|
||||
|
||||
#include <components/l10n/manager.hpp>
|
||||
#include <components/lua/l10n.hpp>
|
||||
#include <components/lua/luastate.hpp>
|
||||
|
||||
#include "../testing_util.hpp"
|
||||
#include <components/testing/util.hpp>
|
||||
|
||||
namespace
|
||||
{
|
@ -1,9 +1,8 @@
|
||||
#include "gmock/gmock.h"
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <components/lua/luastate.hpp>
|
||||
|
||||
#include "../testing_util.hpp"
|
||||
#include <components/testing/util.hpp>
|
||||
|
||||
namespace
|
||||
{
|
@ -1,10 +1,9 @@
|
||||
#include "gmock/gmock.h"
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <components/lua/luastate.hpp>
|
||||
#include <components/lua/utilpackage.hpp>
|
||||
|
||||
#include "../testing_util.hpp"
|
||||
#include <components/testing/util.hpp>
|
||||
|
||||
namespace
|
||||
{
|
@ -1,5 +1,6 @@
|
||||
#include "../testing_util.hpp"
|
||||
#include "components/misc/resourcehelpers.hpp"
|
||||
#include <components/misc/resourcehelpers.hpp>
|
||||
#include <components/testing/util.hpp>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
namespace
|
@ -1,11 +1,10 @@
|
||||
#include <components/settings/parser.hpp>
|
||||
#include <components/testing/util.hpp>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "../testing_util.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
using namespace testing;
|
@ -1,12 +1,11 @@
|
||||
#include <components/settings/shadermanager.hpp>
|
||||
#include <components/testing/util.hpp>
|
||||
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "../testing_util.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
using namespace testing;
|
@ -1,12 +1,11 @@
|
||||
#include <components/files/conversion.hpp>
|
||||
#include <components/shader/shadermanager.hpp>
|
||||
#include <components/testing/util.hpp>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "../testing_util.hpp"
|
||||
|
||||
namespace
|
||||
{
|
||||
using namespace testing;
|
@ -0,0 +1,58 @@
|
||||
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
|
||||
include_directories(SYSTEM ${GMOCK_INCLUDE_DIRS})
|
||||
|
||||
file(GLOB UNITTEST_SRC_FILES
|
||||
main.cpp
|
||||
|
||||
options.cpp
|
||||
|
||||
mwworld/test_store.cpp
|
||||
mwworld/testduration.cpp
|
||||
mwworld/testtimestamp.cpp
|
||||
|
||||
mwdialogue/test_keywordsearch.cpp
|
||||
|
||||
mwscript/test_scripts.cpp
|
||||
)
|
||||
|
||||
source_group(apps\\openmw-tests FILES ${UNITTEST_SRC_FILES})
|
||||
|
||||
openmw_add_executable(openmw-tests ${UNITTEST_SRC_FILES})
|
||||
|
||||
target_link_libraries(openmw-tests
|
||||
GTest::GTest
|
||||
GMock::GMock
|
||||
openmw-lib
|
||||
)
|
||||
|
||||
# Fix for not visible pthreads functions for linker with glibc 2.15
|
||||
if (UNIX AND NOT APPLE)
|
||||
target_link_libraries(openmw-tests ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
if (BUILD_WITH_CODE_COVERAGE)
|
||||
target_compile_options(openmw-tests PRIVATE --coverage)
|
||||
target_link_libraries(openmw-tests gcov)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(openmw-tests
|
||||
PRIVATE OPENMW_DATA_DIR=u8"${CMAKE_CURRENT_BINARY_DIR}/data"
|
||||
OPENMW_PROJECT_SOURCE_DIR=u8"${PROJECT_SOURCE_DIR}")
|
||||
|
||||
if (MSVC AND PRECOMPILE_HEADERS_WITH_MSVC)
|
||||
target_precompile_headers(openmw-tests PRIVATE
|
||||
<boost/program_options/options_description.hpp>
|
||||
|
||||
<gtest/gtest.h>
|
||||
|
||||
<sol/sol.hpp>
|
||||
|
||||
<algorithm>
|
||||
<filesystem>
|
||||
<fstream>
|
||||
<functional>
|
||||
<memory>
|
||||
<string>
|
||||
<vector>
|
||||
)
|
||||
endif()
|
@ -0,0 +1,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
Loading…
Reference in New Issue