1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

[c::b] +tests project

This commit is contained in:
alexvins 2014-04-02 04:39:15 +00:00
parent 67450dfed6
commit 13f72e581e
3 changed files with 41 additions and 3 deletions

View File

@ -82,8 +82,16 @@ BOOST_AUTO_TEST_CASE(CMapEditManager_DrawTerrain_View)
{ {
try try
{ {
// Load maps and json config // Load maps and json config
auto loader = new CFilesystemLoader("test/", ".");
#if defined(__MINGW32__)
const std::string TEST_DATA_DIR = "test/";
#else
const std::string TEST_DATA_DIR = ".";
#endif // defined
auto loader = new CFilesystemLoader("test/", TEST_DATA_DIR);
dynamic_cast<CFilesystemList*>(CResourceHandler::get())->addLoader(loader, false); dynamic_cast<CFilesystemList*>(CResourceHandler::get())->addLoader(loader, false);
const auto originalMap = CMapService::loadMap("test/TerrainViewTest"); const auto originalMap = CMapService::loadMap("test/TerrainViewTest");
auto map = CMapService::loadMap("test/TerrainViewTest"); auto map = CMapService::loadMap("test/TerrainViewTest");

View File

@ -2,7 +2,7 @@
#include "../Global.h" #include "../Global.h"
#ifndef _MSC_VER #if !defined(_MSC_VER) && !defined(__MINGW32__)
#define BOOST_TEST_DYN_LINK #define BOOST_TEST_DYN_LINK
#endif #endif

30
test/Test.cbp Normal file
View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="Test" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/Test" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Unit filename="main.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
</Extensions>
</Project>
</CodeBlocks_project_file>