Files
Bubberstation/code/modules/unit_tests/focus_only_tests.dm
SkyratBot 20d03b6483 [MIRROR] Avoid creating string list of turf platings, rename some of the APIs, and improve focused test support - 160ms+ (more on prod) of init savings [MDB IGNORE] (#18357)
* Avoid creating string list of turf platings, rename some of the APIs, and improve focused test support - 160ms+ (more on prod) of init savings (#72056)

Looking at some stuff that uses `Join` right now as targets, this one's
pretty straight forward.

`/turf/open/floor/Initialize`, called 20,000 times without ruins,
creates a string list of the broken and burnt states. This carries the
fixed cost of `Join`, which is very expensive, as well as some (not
crazy, but not negligible) proc overhead.

These vars were used for effectively nothing, and have been replaced
with just using the list when necessary, which only adds an extra
millisecond of cost to update_overlays.

This was also used to automatically set `broken` and `burnt` at runtime.
However, this looks like it has gone completely unused. Adds a unit test
which adds it as a static field to the only type that cared about it,
which was abductor tiles, which is wrong anyway, but Whatever. I want to
support people making a subtype of floor tiles that are pre-broken
without it messing up stuff silently, so the test is there.

While I'm at it, renames `setup_broken_states` and `setup_burnt_states`
to remove `setup_`, since they don't really do that anymore (and never
did).

Also also, adds support for `PERFORM_ALL_TESTS` to work with multiple
focuses.

For reviewing, basically all of the changes are in floor.dm, aside from
test stuff, which is unit_test.dm.

* Avoid creating string list of turf platings, rename some of the APIs, and improve focused test support - 160ms+ (more on prod) of init savings

* a

* FUCK

* nope

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: John Doe <gamingskeleton3@gmail.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>
2023-01-12 11:39:51 -05:00

26 lines
1.3 KiB
Plaintext

/// These tests perform no behavior of their own, and have their tests offloaded onto other procs.
/// This is useful in cases like in build_appearance_list where we want to know if any fail,
/// but is not useful to right a test for.
/// This file exists so that you can change any of these to TEST_FOCUS and only check for that test.
/// For example, change /datum/unit_test/focus_only/invalid_overlays to TEST_FOCUS(/datum/unit_test/focus_only/invalid_overlays),
/// and you will only test the check for invalid overlays in appearance building.
/datum/unit_test/focus_only
/// Checks that every overlay passed into build_appearance_list exists in the icon
/datum/unit_test/focus_only/invalid_overlays
/// Checks that every icon sent to the research_designs spritesheet is valid
/datum/unit_test/focus_only/invalid_research_designs
/// Checks that every icon sent to vending machines is valid
/datum/unit_test/focus_only/invalid_vending_machine_icon_states
/// Checks that space does not initialize multiple times
/datum/unit_test/focus_only/multiple_space_initialization
/// Checks that smoothing_groups and canSmoothWith are properly sorted in /atom/Initialize
/datum/unit_test/focus_only/sorted_smoothing_groups
/// Checks that floor tiles are properly mapped to broken/burnt
/datum/unit_test/focus_only/valid_turf_states