From e65f11731155dec69701d806ba00c6bd24ffc33c Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Thu, 24 Sep 2009 20:18:07 +0530 Subject: Set up a basic testing framework for LOS. ./crawl -test with a full debug build will run the test. --- crawl-ref/source/acr.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crawl-ref/source/acr.cc') 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 \" v arena:\""); +#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(); -- cgit v1.2.3-54-g00ecf