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:
@@ -1,2 +1,2 @@
|
||||
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"
|
||||
|
||||
@@ -32,7 +32,7 @@ std::string ToHex(T* pointer)
|
||||
#define DebugTrace(inString) \
|
||||
{ \
|
||||
std::ostringstream stream; \
|
||||
stream << inString << std::endl; \
|
||||
stream << inString; \
|
||||
qDebug("%s", stream.str().c_str()); \
|
||||
}
|
||||
#elif defined (ANDROID)
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#if defined(ANDROID)
|
||||
#include "../../include/PrecompiledHeader.h"
|
||||
#endif
|
||||
#include "PrecompiledHeader.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable : 4786)
|
||||
@@ -125,13 +123,18 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
|
||||
|
||||
DebugTrace("User path " << userPath);
|
||||
#elif defined (QT_CONFIG)
|
||||
QDir dir(QDir::homePath());
|
||||
dir.cd(USERDIR);
|
||||
|
||||
QDir sysDir("projects/mtg/bin/Res");
|
||||
QDir dir(QDir::homePath());
|
||||
dir.mkdir(USERDIR);
|
||||
dir.cd(USERDIR);
|
||||
|
||||
userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString();
|
||||
systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString();
|
||||
|
||||
DebugTrace("User path " << userPath);
|
||||
DebugTrace("System path " << systemPath);
|
||||
DebugTrace("Current path " << QDir::currentPath().toStdString());
|
||||
#else
|
||||
//Find the Res.txt file and matching Res folders for backwards compatibility
|
||||
ifstream mfile("Res.txt");
|
||||
|
||||
@@ -383,8 +383,8 @@ void GameObserver::resetStartupGame()
|
||||
startupGameSerialized = "";
|
||||
stream << *this;
|
||||
startupGameSerialized = stream.str();
|
||||
DebugTrace("startGame\n");
|
||||
DebugTrace(startupGameSerialized);
|
||||
// DebugTrace("startGame\n");
|
||||
// DebugTrace(startupGameSerialized);
|
||||
}
|
||||
|
||||
void GameObserver::startGame(GameType gtype, Rules * rules)
|
||||
|
||||
@@ -336,13 +336,22 @@ void MTGAllCards::init()
|
||||
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);
|
||||
|
||||
if (!files.size())
|
||||
{
|
||||
DebugTrace("loadPrimitives:WARNING:Primitives folder is missing");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -355,7 +364,7 @@ void MTGAllCards::loadFolder(const string& folder, const string& filename )
|
||||
continue;
|
||||
|
||||
if(JFileSystem::GetInstance()->DirExists(afile))
|
||||
loadFolder(string(afile).c_str(), filename);
|
||||
loadFolder(afile, filename);
|
||||
|
||||
if (!JFileSystem::GetInstance()->FileExists(afile))
|
||||
continue;
|
||||
@@ -382,7 +391,10 @@ int MTGAllCards::load(const char * config_file, const char * set_name, int)
|
||||
std::string contents;
|
||||
izfstream file;
|
||||
if (!JFileSystem::GetInstance()->openForRead(file, config_file))
|
||||
{
|
||||
DebugTrace("MTGAllCards::load: error loading: " << config_file);
|
||||
return total_cards;
|
||||
}
|
||||
|
||||
string s;
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ int TestSuiteAI::Act(float)
|
||||
timer = 0;
|
||||
|
||||
string action = suite->getNextAction();
|
||||
observer->mLayers->stackLayer()->Dump();
|
||||
// observer->mLayers->stackLayer()->Dump();
|
||||
DebugTrace("TESTSUITE command: " << action);
|
||||
|
||||
if (observer->mLayers->stackLayer()->askIfWishesToInterrupt == this)
|
||||
|
||||
Reference in New Issue
Block a user