Merge branch 'develop'

Activates full testsuite run in Travis CI. Travis will complain as soon as at least one testcase does not pass successfully after a new commit.
This commit is contained in:
xawotihs
2013-10-30 23:10:03 +01:00
6 changed files with 28 additions and 13 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
language: cpp language: cpp
script: "qmake projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug && make -j 8" script: "qmake projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug && make -j 8 && ./wagic"
+1 -1
View File
@@ -32,7 +32,7 @@ std::string ToHex(T* pointer)
#define DebugTrace(inString) \ #define DebugTrace(inString) \
{ \ { \
std::ostringstream stream; \ std::ostringstream stream; \
stream << inString << std::endl; \ stream << inString; \
qDebug("%s", stream.str().c_str()); \ qDebug("%s", stream.str().c_str()); \
} }
#elif defined (ANDROID) #elif defined (ANDROID)
+8 -5
View File
@@ -16,9 +16,7 @@ User folder is the only one that is really needed to guarantee both read and wri
The content that users should not be touching. The content that users should not be touching.
*/ */
#if defined(ANDROID) #include "PrecompiledHeader.h"
#include "../../include/PrecompiledHeader.h"
#endif
#ifdef WIN32 #ifdef WIN32
#pragma warning(disable : 4786) #pragma warning(disable : 4786)
@@ -125,13 +123,18 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
DebugTrace("User path " << userPath); DebugTrace("User path " << userPath);
#elif defined (QT_CONFIG) #elif defined (QT_CONFIG)
QDir dir(QDir::homePath());
dir.cd(USERDIR);
QDir sysDir("projects/mtg/bin/Res"); QDir sysDir("projects/mtg/bin/Res");
QDir dir(QDir::homePath());
dir.mkdir(USERDIR);
dir.cd(USERDIR);
userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString(); userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString();
systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString(); systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString();
DebugTrace("User path " << userPath);
DebugTrace("System path " << systemPath);
DebugTrace("Current path " << QDir::currentPath().toStdString());
#else #else
//Find the Res.txt file and matching Res folders for backwards compatibility //Find the Res.txt file and matching Res folders for backwards compatibility
ifstream mfile("Res.txt"); ifstream mfile("Res.txt");
+2 -2
View File
@@ -383,8 +383,8 @@ void GameObserver::resetStartupGame()
startupGameSerialized = ""; startupGameSerialized = "";
stream << *this; stream << *this;
startupGameSerialized = stream.str(); startupGameSerialized = stream.str();
DebugTrace("startGame\n"); // DebugTrace("startGame\n");
DebugTrace(startupGameSerialized); // DebugTrace(startupGameSerialized);
} }
void GameObserver::startGame(GameType gtype, Rules * rules) void GameObserver::startGame(GameType gtype, Rules * rules)
+15 -3
View File
@@ -336,13 +336,22 @@ void MTGAllCards::init()
initCounters(); initCounters();
} }
void MTGAllCards::loadFolder(const string& folder, const string& filename ) void MTGAllCards::loadFolder(const string& infolder, const string& filename )
{ {
string folder = infolder;
// Make sure the base paths finish with a '/' or a '\'
if (! folder.empty()) {
string::iterator c = folder.end();//userPath.at(userPath.size()-1);
c--;
if ((*c != '/') && (*c != '\\'))
folder += '/';
}
vector<string> files = JFileSystem::GetInstance()->scanfolder(folder); vector<string> files = JFileSystem::GetInstance()->scanfolder(folder);
if (!files.size()) if (!files.size())
{ {
DebugTrace("loadPrimitives:WARNING:Primitives folder is missing");
return; return;
} }
@@ -355,7 +364,7 @@ void MTGAllCards::loadFolder(const string& folder, const string& filename )
continue; continue;
if(JFileSystem::GetInstance()->DirExists(afile)) if(JFileSystem::GetInstance()->DirExists(afile))
loadFolder(string(afile).c_str(), filename); loadFolder(afile, filename);
if (!JFileSystem::GetInstance()->FileExists(afile)) if (!JFileSystem::GetInstance()->FileExists(afile))
continue; continue;
@@ -382,7 +391,10 @@ int MTGAllCards::load(const char * config_file, const char * set_name, int)
std::string contents; std::string contents;
izfstream file; izfstream file;
if (!JFileSystem::GetInstance()->openForRead(file, config_file)) if (!JFileSystem::GetInstance()->openForRead(file, config_file))
{
DebugTrace("MTGAllCards::load: error loading: " << config_file);
return total_cards; return total_cards;
}
string s; string s;
+1 -1
View File
@@ -114,7 +114,7 @@ int TestSuiteAI::Act(float)
timer = 0; timer = 0;
string action = suite->getNextAction(); string action = suite->getNextAction();
observer->mLayers->stackLayer()->Dump(); // observer->mLayers->stackLayer()->Dump();
DebugTrace("TESTSUITE command: " << action); DebugTrace("TESTSUITE command: " << action);
if (observer->mLayers->stackLayer()->askIfWishesToInterrupt == this) if (observer->mLayers->stackLayer()->askIfWishesToInterrupt == this)