diff options
Diffstat (limited to 'crawl-ref/source/acr.cc')
-rw-r--r-- | crawl-ref/source/acr.cc | 19 |
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(); |