mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Move test filesystem creation to global fixture
This commit is contained in:
parent
126a821960
commit
6977fc3a14
@ -365,6 +365,7 @@ void CGObjectInstance::writeJsonOptions(JsonNode & json) const
|
||||
{
|
||||
json.setType(JsonNode::DATA_STRUCT);
|
||||
|
||||
//todo: move up to descendants
|
||||
if(tempOwner != PlayerColor::UNFLAGGABLE)
|
||||
{
|
||||
PlayerColor p (tempOwner);
|
||||
|
@ -12,11 +12,9 @@
|
||||
#include "StdInc.h"
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include "../lib/filesystem/ResourceID.h"
|
||||
#include "../lib/mapping/CMapService.h"
|
||||
#include "../lib/mapping/CMap.h"
|
||||
#include "../lib/filesystem/Filesystem.h"
|
||||
#include "../lib/filesystem/CFilesystemLoader.h"
|
||||
#include "../lib/filesystem/AdapterLoaders.h"
|
||||
#include "../lib/JsonNode.h"
|
||||
#include "../lib/mapping/CMapEditManager.h"
|
||||
#include "../lib/int3.h"
|
||||
@ -117,10 +115,6 @@ BOOST_AUTO_TEST_CASE(CMapEditManager_DrawTerrain_View)
|
||||
try
|
||||
{
|
||||
// Load maps and json config
|
||||
const std::string TEST_DATA_DIR = "test/";
|
||||
|
||||
auto loader = new CFilesystemLoader("test/", TEST_DATA_DIR);
|
||||
dynamic_cast<CFilesystemList*>(CResourceHandler::get())->addLoader(loader, false);
|
||||
const auto originalMap = CMapService::loadMap("test/TerrainViewTest");
|
||||
auto map = CMapService::loadMap("test/TerrainViewTest");
|
||||
logGlobal->infoStream() << "Loaded test map successfully.";
|
||||
|
@ -18,6 +18,9 @@
|
||||
#include "../lib/VCMI_Lib.h"
|
||||
#include "../lib/logging/CLogger.h"
|
||||
#include "../lib/CConfigHandler.h"
|
||||
#include "../lib/filesystem/Filesystem.h"
|
||||
#include "../lib/filesystem/CFilesystemLoader.h"
|
||||
#include "../lib/filesystem/AdapterLoaders.h"
|
||||
|
||||
CVcmiTestConfig::CVcmiTestConfig()
|
||||
{
|
||||
@ -29,6 +32,11 @@ CVcmiTestConfig::CVcmiTestConfig()
|
||||
logConfig.configure();
|
||||
loadDLLClasses();
|
||||
logGlobal->infoStream() << "Initialized global test setup.";
|
||||
|
||||
const std::string TEST_DATA_DIR = "test/";
|
||||
|
||||
auto loader = new CFilesystemLoader("test/", TEST_DATA_DIR);
|
||||
dynamic_cast<CFilesystemList*>(CResourceHandler::get())->addLoader(loader, false);
|
||||
}
|
||||
|
||||
CVcmiTestConfig::~CVcmiTestConfig()
|
||||
|
Loading…
Reference in New Issue
Block a user