mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 21:12:24 +01:00
Adds ability for unit tests to only run on certain maps. Moves aurora & sccv_horizon tests appropriately.
This commit is contained in:
@@ -48,6 +48,12 @@
|
||||
var/datum/unit_test/test = curr[curr.len]
|
||||
curr.len--
|
||||
|
||||
if (test.map_path && current_map && current_map.path != test.map_path)
|
||||
test.pass("[ascii_red]Check Disabled: This test is not allowed to run on this map.")
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
continue
|
||||
|
||||
if (test.disabled)
|
||||
test.pass("[ascii_red]Check Disabled: [test.why_disabled]")
|
||||
if (MC_TICK_CHECK)
|
||||
|
||||
@@ -41,36 +41,36 @@ var/ascii_reset = "[ascii_esc]\[0m"
|
||||
// We list these here so we can remove them from the for loop running this.
|
||||
// Templates aren't intended to be ran but just serve as a way to create child objects of it with inheritable tests for quick test creation.
|
||||
|
||||
datum/unit_test
|
||||
/datum/unit_test
|
||||
var/name = "template - should not be ran."
|
||||
var/disabled = 0 // If we want to keep a unit test in the codebase but not run it for some reason.
|
||||
var/async = 0 // If the check can be left to do it's own thing, you must define a check_result() proc if you use this.
|
||||
var/reported = 0 // If it's reported a success or failure. Any tests that have not are assumed to be failures.
|
||||
var/why_disabled = "No reason set." // If we disable a unit test we will display why so it reminds us to check back on it later.
|
||||
var/map_path // This should be the same as the path var on /datum/map - The unit test will only run for that map
|
||||
|
||||
|
||||
datum/unit_test/proc/fail(var/message)
|
||||
/datum/unit_test/proc/fail(var/message)
|
||||
all_unit_tests_passed = 0
|
||||
failed_unit_tests++
|
||||
reported = 1
|
||||
log_unit_test("[ascii_red]!!! FAILURE !!! \[[name]\]: [message][ascii_reset]")
|
||||
|
||||
datum/unit_test/proc/pass(var/message)
|
||||
/datum/unit_test/proc/pass(var/message)
|
||||
reported = 1
|
||||
log_unit_test("[ascii_green]*** SUCCESS *** \[[name]\]: [message][ascii_reset]")
|
||||
|
||||
datum/unit_test/proc/warn(var/message)
|
||||
/datum/unit_test/proc/warn(var/message)
|
||||
log_unit_test("[ascii_yellow]=== WARNING === \[[name]\]: [message][ascii_reset]")
|
||||
|
||||
datum/unit_test/proc/start_test()
|
||||
/datum/unit_test/proc/start_test()
|
||||
fail("No test proc.")
|
||||
|
||||
datum/unit_test/proc/check_result()
|
||||
/datum/unit_test/proc/check_result()
|
||||
fail("No check results proc")
|
||||
return 1
|
||||
|
||||
|
||||
proc/load_unit_test_changes()
|
||||
/proc/load_unit_test_changes()
|
||||
/*
|
||||
//This takes about 60 seconds to run on Travis and is only used for the ZAS vacume check on The Asteroid.
|
||||
if(config.generate_asteroid != 1)
|
||||
|
||||
@@ -109,23 +109,11 @@ datum/unit_test/zas_area_test/supply_centcomm
|
||||
name = "ZAS: Supply Shuttle (CentComm)"
|
||||
area_path = /area/supply/dock
|
||||
|
||||
datum/unit_test/zas_area_test/emergency_shuttle
|
||||
name = "ZAS: Emergency Shuttle"
|
||||
area_path = /area/shuttle/escape
|
||||
|
||||
datum/unit_test/zas_area_test/ai_chamber
|
||||
name = "ZAS: AI Chamber"
|
||||
area_path = /area/turret_protected/ai
|
||||
expectation = UT_NORMAL_COOL
|
||||
|
||||
datum/unit_test/zas_area_test/arrival_maint
|
||||
name = "ZAS: Arrival Maintenance"
|
||||
area_path = /area/maintenance/arrivals
|
||||
|
||||
datum/unit_test/zas_area_test/
|
||||
name = "ZAS: Cargo Maintenance"
|
||||
area_path = /area/maintenance/cargo
|
||||
|
||||
datum/unit_test/zas_area_test/xenobio
|
||||
name = "ZAS: Xenobiology"
|
||||
area_path = /area/rnd/xenobiology
|
||||
@@ -138,10 +126,6 @@ datum/unit_test/zas_area_test/mining_area
|
||||
disabled = 1
|
||||
why_disabled = "Asteroid Generation disabled"
|
||||
*/
|
||||
datum/unit_test/zas_area_test/
|
||||
name = "ZAS: Cargo Bay"
|
||||
area_path = /area/quartermaster/storage
|
||||
|
||||
|
||||
// ==================================================================================================
|
||||
|
||||
|
||||
@@ -36,3 +36,21 @@
|
||||
,/area/medical/patient_c
|
||||
,/area/security/penal_colony
|
||||
)
|
||||
|
||||
/datum/unit_test/zas_area_test/aurora
|
||||
map_path = "aurora"
|
||||
/datum/unit_test/zas_area_test/aurora/arrival_maint
|
||||
name = "ZAS: Arrival Maintenance"
|
||||
area_path = /area/maintenance/arrivals
|
||||
|
||||
/datum/unit_test/zas_area_test/aurora/emergency_shuttle
|
||||
name = "ZAS: Emergency Shuttle"
|
||||
area_path = /area/shuttle/escape
|
||||
|
||||
/datum/unit_test/zas_area_test/aurora/zas_area_test
|
||||
name = "ZAS: Cargo Bay"
|
||||
area_path = /area/quartermaster/storage
|
||||
|
||||
/datum/unit_test/zas_area_test/aurora/cargo_maint
|
||||
name = "ZAS: Cargo Maintenance"
|
||||
area_path = /area/maintenance/cargo
|
||||
|
||||
@@ -47,10 +47,8 @@
|
||||
,/area/rnd/isolation_c
|
||||
)
|
||||
|
||||
/datum/unit_test/zas_area_test
|
||||
/datum/unit_test/zas_area_test/sccv_horizon
|
||||
map_path = "sccv_horizon"
|
||||
/datum/unit_test/zas_area_test/sccv_horizon/storage
|
||||
name = "ZAS: Operations Bay"
|
||||
area_path = /area/operations/storage
|
||||
|
||||
/datum/unit_test/zas_area_test/arrival_maint
|
||||
name = "ZAS: Arrival Maintenance"
|
||||
area_path = /area/maintenance/arrivals
|
||||
|
||||
Reference in New Issue
Block a user