summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/acr.cc
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2009-09-24 20:18:07 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2009-09-24 20:27:06 +0530
commite65f11731155dec69701d806ba00c6bd24ffc33c (patch)
tree58d06a0b0b9d300ce3c6a59fec5ecd01ca8c7582 /crawl-ref/source/acr.cc
parent383469b3ec04e7343eab5460e948f32b3857943a (diff)
downloadcrawl-ref-e65f11731155dec69701d806ba00c6bd24ffc33c.tar.gz
crawl-ref-e65f11731155dec69701d806ba00c6bd24ffc33c.zip
Set up a basic testing framework for LOS. ./crawl -test with a full debug build will run the test.
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r--crawl-ref/source/acr.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 2da1b34de9..ad5b968a30 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -53,6 +53,7 @@ REVISION("$Rev$");
#include "cloud.h"
#include "clua.h"
#include "command.h"
+#include "ctest.h"
#include "crash.h"
#include "database.h"
#include "debug.h"
@@ -316,6 +317,10 @@ static void _show_commandline_options_help()
puts("");
puts("Arena options: (Stage a tournament between various monsters.)");
puts(" -arena \"<monster list> v <monster list> arena:<arena map>\"");
+#if DEBUG_DIAGNOSTICS
+ puts("");
+ puts(" -test run test cases in ./test");
+#endif
}
static void _wanderer_startup_message()
@@ -3508,6 +3513,20 @@ static bool _initialise(void)
}
#endif
+ if (crawl_state.test)
+ {
+#ifdef DEBUG_DIAGNOSTICS
+ crawl_tests::run_tests(true);
+ // Superfluous, just to make it clear that this is the end of
+ // the line.
+ end(0, false);
+#else
+ end(1, false, "Non-debug Crawl cannot run tests. "
+ "Please use a debug build");
+#endif
+ }
+
+
if (crawl_state.arena)
{
run_map_preludes();