From 11b1348fd4b52a35851a03a9c50bd962e385a6a9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 4 Jan 2012 20:53:28 +0300 Subject: Add ability for testing drivers and graphics. --- src/main.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') 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(); + } } -- cgit v1.2.3-70-g09d2