Files
Bubberstation/code/modules/unit_tests/mapping.dm
MrMelbert aacc85964a Adds a unit test that all roundstart spawnable jobs have a landmark to spawn at (#74995)
## About The Pull Request


https://github.com/tgstation/tgstation/pull/74985#issuecomment-1523773626

Tests that all jobs that have `spawn_position > 0` at roundstart have a
location to spawn at.

Also changes the failure message for
`get_default_roundstart_spawn_point` to send to `log_mapping` rather
than `log_world`, as it is a map error and log world doesn't really help
anyone. This would've been sufficient for the existing unit test
`log_mapping`, but that unit test expects that the log has an areacoord
supplied, which we can't really do, given we're reporting a _lack_ of
something.

## Why It's Good For The Game

Stops maps from regressing and dumping people on the latejoin shuttle
roundstart.

## Changelog

~~Not necessary unless I find a map which forgot a landmark~~

🆑 Melbert
fix: Tramstation Robotics and RD now spawn in their departments
roundstart
fix: Birdboat detective now spawns in their office
/🆑
2023-05-04 14:03:49 -06:00

20 lines
842 B
Plaintext

/// Conveys all log_mapping messages as unit test failures, as they all indicate mapping problems.
/datum/unit_test/log_mapping
// Happen before all other tests, to make sure we only capture normal mapping logs.
priority = TEST_PRE
/datum/unit_test/log_mapping/Run()
var/static/regex/test_areacoord_regex = regex(@"\(-?\d+,-?\d+,(-?\d+)\)")
for(var/log_entry in GLOB.unit_test_mapping_logs)
// Only fail if AREACOORD was conveyed, and it's a station or mining z-level.
// This is due to mapping errors don't have coords being impossible to diagnose as a unit test,
// and various ruins frequently intentionally doing non-standard things.
if(!test_areacoord_regex.Find(log_entry))
continue
var/z = text2num(test_areacoord_regex.group[1])
if(!is_station_level(z) && !is_mining_level(z))
continue
TEST_FAIL(log_entry)