summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-04 20:53:28 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-04 20:58:00 +0300
commit11b1348fd4b52a35851a03a9c50bd962e385a6a9 (patch)
treecff1c3237c2cf05cb9f4de9b5084762ce374a947 /src/main.cpp
parenta7aa62d82574128cba8fd3c10d29e2bbcfca305d (diff)
downloadmanaplus-11b1348fd4b52a35851a03a9c50bd962e385a6a9.tar.gz
manaplus-11b1348fd4b52a35851a03a9c50bd962e385a6a9.tar.bz2
manaplus-11b1348fd4b52a35851a03a9c50bd962e385a6a9.tar.xz
manaplus-11b1348fd4b52a35851a03a9c50bd962e385a6a9.zip
Add ability for testing drivers and graphics.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 281687809..31d88082f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -71,6 +71,7 @@ static void printHelp()
" directory") << endl
<< _(" --screenshot-dir : Directory to store screenshots") << endl
<< _(" --safemode : Start game in safe mode") << endl
+ << _(" -T --tests : Start testing drivers and auto configuring") << endl
#ifdef USE_OPENGL
<< _(" --no-opengl : Disable OpenGL for this session") << endl
#endif
@@ -84,7 +85,7 @@ static void printVersion()
static void parseOptions(int argc, char *argv[], Client::Options &options)
{
- const char *optstring = "hvud:U:P:Dc:p:l:L:C:s:";
+ const char *optstring = "hvud:U:P:Dc:p:l:L:C:s:t:T";
const struct option long_options[] =
{
@@ -107,6 +108,8 @@ static void parseOptions(int argc, char *argv[], Client::Options &options)
{ "chat-log-dir", required_argument, 0, 'L' },
{ "screenshot-dir", required_argument, 0, 'i' },
{ "safemode", no_argument, 0, 'm' },
+ { "tests", no_argument, 0, 'T' },
+ { "test", required_argument, 0, 't' },
{ nullptr, 0, 0, 0 }
};
@@ -174,6 +177,14 @@ static void parseOptions(int argc, char *argv[], Client::Options &options)
case 'm':
options.safeMode = true;
break;
+ case 'T':
+ options.testMode = true;
+ options.test = "";
+ break;
+ case 't':
+ options.testMode = true;
+ options.test = std::string(optarg);
+ break;
default:
break;
}
@@ -247,5 +258,14 @@ int main(int argc, char *argv[])
SetCurrentDirectory(PHYSFS_getBaseDir());
#endif
Client client(options);
- return client.exec();
+ if (!options.testMode)
+ {
+ client.gameInit();
+ return client.gameExec();
+ }
+ else
+ {
+ client.testsInit();
+ return client.testsExec();
+ }
}