summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-07 02:21:59 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-07 04:10:10 +0300
commit229b55863347dc346f3ad816e38b84b456ee527c (patch)
tree8d0c0f549f853f1511395a18772d0fd6dcd9b642
parent3acedd2fadd68550798a5eec0550a855dbc05d85 (diff)
downloadplus-229b55863347dc346f3ad816e38b84b456ee527c.tar.gz
plus-229b55863347dc346f3ad816e38b84b456ee527c.tar.bz2
plus-229b55863347dc346f3ad816e38b84b456ee527c.tar.xz
plus-229b55863347dc346f3ad816e38b84b456ee527c.zip
Use absolute path for launching tests.
-rw-r--r--src/main.cpp4
-rw-r--r--src/test/testmain.cpp11
2 files changed, 11 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f704d68c7..1988e5962 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -39,6 +39,8 @@
#include "debug.h"
+char *selfName = nullptr;
+
static void printHelp()
{
using std::endl;
@@ -228,6 +230,8 @@ int main(int argc, char *argv[])
LoadLibrary("exchndl.dll");
#endif
+ selfName = argv[0];
+
// Parse command line options
Client::Options options;
parseOptions(argc, argv, options);
diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp
index 712133d41..287eeb706 100644
--- a/src/test/testmain.cpp
+++ b/src/test/testmain.cpp
@@ -35,14 +35,17 @@
#include "debug.h"
+std::string fileName = "";
+extern char *selfName;
+
+TestMain::TestMain()
+{
#ifdef WIN32
- const std::string fileName = "manaplus.exe";
+ fileName = "manaplus.exe";
#else
- const std::string fileName = "manaplus";
+ fileName = selfName;
#endif
-TestMain::TestMain()
-{
log = new Logger;
// log->setLogFile(Client::getLocalDataDirectory()
// + std::string("/test.log"));