浏览代码

[c::b] +tests project

alexvins 11 年之前
父节点
当前提交
13f72e581e
共有 3 个文件被更改,包括 41 次插入3 次删除
  1. 10 2
      test/CMapEditManagerTest.cpp
  2. 1 1
      test/StdInc.h
  3. 30 0
      test/Test.cbp

+ 10 - 2
test/CMapEditManagerTest.cpp

@@ -82,8 +82,16 @@ BOOST_AUTO_TEST_CASE(CMapEditManager_DrawTerrain_View)
 {
 	try
 	{
-		// Load maps and json config
-		auto loader = new CFilesystemLoader("test/", ".");
+		// Load maps and json config
+		
+		#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);
 		const auto originalMap = CMapService::loadMap("test/TerrainViewTest");
 		auto map = CMapService::loadMap("test/TerrainViewTest");

+ 1 - 1
test/StdInc.h

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

+ 30 - 0
test/Test.cbp

@@ -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>