diff --git a/code/_compile_options.dm b/code/_compile_options.dm index c0c2ffc2714..a7d8bcbd35c 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -1,8 +1,8 @@ #define DEBUG //#define TESTING -// Uncomment the following line to compile unit tests. -// #define UNIT_TESTS +// Uncomment the following line to compile unit tests on a local server. The output will be in a test_run-[DATE].log file in the ./data folder. +// #define LOCAL_UNIT_TESTS // Uncomment the following line to enable Tracy profiling. // DO NOT DO THIS UNLESS YOU UNDERSTAND THE IMPLICATIONS @@ -12,10 +12,18 @@ // Uncomment this to enable support for multiple instances // #define MULTIINSTANCE +#ifdef LOCAL_UNIT_TESTS +#define UNIT_TESTS +#endif + #ifdef CIBUILDING #define UNIT_TESTS #endif +#if defined(CIBUILDING) && defined(LOCAL_UNIT_TESTS) +#error CIBUILDING and LOCAL_UNIT_TESTS should not be enabled at the same time! +#endif + /***** All toggles for the GC ref finder *****/ // #define REFERENCE_TRACKING // Uncomment to enable ref finding diff --git a/code/modules/unit_tests/test_runner.dm b/code/modules/unit_tests/test_runner.dm index e17d72b84bb..f004d0ac592 100644 --- a/code/modules/unit_tests/test_runner.dm +++ b/code/modules/unit_tests/test_runner.dm @@ -3,7 +3,11 @@ // intentionally (if there's a lot of legitimate map errors), or accidentally if // a test condition is written incorrectly and starts e.g. logging failures for // every single tile. +#ifdef LOCAL_UNIT_TESTS +#define MAX_MAP_TEST_FAILURE_COUNT 100 +#else #define MAX_MAP_TEST_FAILURE_COUNT 20 +#endif /datum/test_runner var/datum/unit_test/current_test @@ -76,6 +80,11 @@ /datum/test_runner/proc/Finalize(emit_failures = FALSE) var/time = world.timeofday set waitfor = FALSE + + #ifdef LOCAL_UNIT_TESTS + emit_failures = TRUE + #endif + var/list/fail_reasons if(GLOB) if(GLOB.total_runtimes != 0)