Init Sanity Unit Test (#25442)

* Init Sanity Unit Test

* Oops

* Update code/modules/unit_tests/init_sanity.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Signed-off-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* Makes noticeboard less silly

---------

Signed-off-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
This commit is contained in:
AffectedArc07
2024-05-23 19:43:33 +00:00
committed by GitHub
co-authored by Contrabang DGamerL
parent 23ad8a48fa
commit 03cca11f95
43 changed files with 222 additions and 279 deletions
@@ -1,8 +1,3 @@
#define BAD_INIT_QDEL_BEFORE (1<<0)
#define BAD_INIT_DIDNT_INIT (1<<1)
#define BAD_INIT_SLEPT (1<<2)
#define BAD_INIT_NO_HINT (1<<3)
SUBSYSTEM_DEF(atoms)
name = "Atoms"
init_order = INIT_ORDER_ATOMS
@@ -123,7 +118,25 @@ SUBSYSTEM_DEF(atoms)
old_initialized = SSatoms.old_initialized
BadInitializeCalls = SSatoms.BadInitializeCalls
#undef BAD_INIT_QDEL_BEFORE
#undef BAD_INIT_DIDNT_INIT
#undef BAD_INIT_SLEPT
#undef BAD_INIT_NO_HINT
/client/proc/debug_atom_init()
set name = "Atom Init Log"
set category = "Debug"
set desc = "Shows what failed to init this round"
if(!check_rights(R_DEBUG | R_VIEWRUNTIMES))
return
var/list/html_data = list()
html_data += "<h1>Bad Initialize() Calls</h1><table border='1'><tr><th scope='col'>Type</th><th scope='col'>Qdeleted before init</th><th scope='col'>Did not init</th><th scope='col'>Slept during init</th><th scope='col'>No init hint</th></tr>"
for(var/typepath in SSatoms.BadInitializeCalls)
var/val = SSatoms.BadInitializeCalls[typepath]
html_data += "<tr><td>[typepath]</td><td>[val & BAD_INIT_QDEL_BEFORE ? "X" : "&nbsp;"]</td><td>[val & BAD_INIT_DIDNT_INIT ? "X" : "&nbsp;"]</td><td>[val & BAD_INIT_SLEPT ? "X" : "&nbsp;"]</td><td>[val & BAD_INIT_NO_HINT ? "X" : "&nbsp;"]</td></tr>"
html_data += "</table>"
usr << browse(html_data.Join(), "window=initdebug")
@@ -8,10 +8,32 @@ SUBSYSTEM_DEF(late_mapping)
flags = SS_NO_FIRE
/// List of all maze generators to process
var/list/obj/effect/mazegen/generator/maze_generators = list()
/// List of all bridge spawners to process
var/list/obj/effect/spawner/bridge/bridge_spawners = list()
/datum/controller/subsystem/late_mapping/Initialize()
if(length(maze_generators))
var/watch = start_watch()
log_startup_progress("Generating mazes...")
for(var/i in maze_generators)
var/obj/effect/mazegen/generator/MG = i
MG.run_generator()
var/list/mgcount = length(maze_generators) // Keeping track of this here because we wipe it next line down
QDEL_LIST_CONTENTS(maze_generators)
var/duration = stop_watch(watch)
log_startup_progress("Generated [mgcount] mazes in [duration]s")
if(length(bridge_spawners))
var/watch = start_watch()
log_startup_progress("Spawning bridges...")
for(var/i in bridge_spawners)
var/obj/effect/spawner/bridge/BS = i
BS.generate_bridge()
var/list/bscount = length(bridge_spawners) // Keeping track of this here because we wipe it next line down
QDEL_LIST_CONTENTS(bridge_spawners)
var/duration = stop_watch(watch)
log_startup_progress("Spawned [bscount] bridges in [duration]s")