mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Better Unit Tests - Runs All Of Them On A Single Map (exc. map unit tests) and C&D Split-Up (#96368)
## About The Pull Request
### Don't run every single test
I've had this on my mind for several months and it being brought up
recently reminded me so here we are.
Unit tests only run on `runtimestation_minimal.dmm` now with the
exception of map tests. The following unit tests are declared as map
tests but I didn't see any map dependent logic so 🤷
- `/datum/unit_test/maptest_baseturfs_unmodified_scrape`
- `/datum/unit_test/maptest_baseturfs_placed_on_top`
- `/datum/unit_test/maptest_baseturfs_placed_on_bottom`
- `/datum/unit_test/maptest_get_turf_pixel`
- `/datum/unit_test/maptest_load_map_security`
- `/datum/unit_test/maptest_modular_map_loader`
- `/datum/unit_test/maptest_turf_icons`
`/datum/unit_test/subsystem_init` isn't really a mapping unit test but I
figured somehow, someway, maps might fuck with subsystem initializations
so I just decided to include it.
### Splits up the create & destroy test
Idk, pretty simple. Create & destroy is now split up across all
integration tests and ran in parallel.
## Why It's Good For The Game
oranges promised me "500 nzd" yo
## Changelog
No player facing changes
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
/// *Only* run the test provided within the parentheses
|
||||
/// This is useful for debugging when you want to reduce noise, but should never be pushed
|
||||
/// Intended to be used in the manner of `TEST_FOCUS(/datum/unit_test/math)`
|
||||
#define TEST_FOCUS(test_path) ##test_path { focus = TRUE; }
|
||||
#define TEST_FOCUS(test_path) ##test_path { test_flags = UNIT_TEST_FOCUS; }
|
||||
|
||||
/// Run the test provided within the parentheses run_count times
|
||||
/// Useful for debugging flaky tests that only fail sometimes
|
||||
@@ -67,6 +67,16 @@
|
||||
*/
|
||||
#define TEST_AFTER_CREATE_AND_DESTROY INFINITY
|
||||
|
||||
// Unit test bitflags
|
||||
|
||||
/// If any unit test has this bitflag, only unit tests with UNIT_TEST_FOCUS will run.
|
||||
#define UNIT_TEST_FOCUS (1<<0)
|
||||
/// This unit test only runs on specially designated unit test maps (Should only ever be one).
|
||||
#define UNIT_TEST_DEBUG_MAP_ONLY (1<<1)
|
||||
|
||||
#define UNIT_TEST_BASIC (UNIT_TEST_DEBUG_MAP_ONLY)
|
||||
#define UNIT_TEST_MAP_TEST (NONE)
|
||||
|
||||
/// Change color to red on ANSI terminal output, if enabled with -DANSICOLORS.
|
||||
#ifdef ANSICOLORS
|
||||
#define TEST_OUTPUT_RED(text) "\x1B\x5B1;31m[text]\x1B\x5B0m"
|
||||
|
||||
Reference in New Issue
Block a user