Makes Travis fail PRs that runtime during init/unit testing.

This commit is contained in:
Neerti
2020-03-09 11:34:14 -04:00
parent a4100b5b74
commit 73261cfbc6
4 changed files with 10 additions and 7 deletions

View File

@@ -1,7 +1,9 @@
// error_cooldown items will either be positive (cooldown time) or negative (silenced error)
// If negative, starts at -1, and goes down by 1 each time that error gets skipped
var/total_runtimes = 0
var/total_runtimes_skipped = 0
GLOBAL_VAR_INIT(total_runtimes, 0)
GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
// The ifdef needs to be down here, since the error viewer references total_runtimes
#ifdef DEBUG
/world/Error(var/exception/e, var/datum/e_src)
@@ -10,7 +12,7 @@ var/total_runtimes_skipped = 0
return ..()
if(!GLOB.error_last_seen) // A runtime is occurring too early in start-up initialization
return ..()
total_runtimes++
GLOB.total_runtimes++
var/erroruid = "[e.file][e.line]"
var/last_seen = GLOB.error_last_seen[erroruid]
@@ -20,7 +22,7 @@ var/total_runtimes_skipped = 0
last_seen = world.time
if(cooldown < 0)
GLOB.error_cooldown[erroruid]-- // Used to keep track of skip count for this error
total_runtimes_skipped++
GLOB.total_runtimes_skipped++
return // Error is currently silenced, skip handling it
// Handle cooldowns and silencing spammy errors

View File

@@ -88,7 +88,7 @@ var/global/datum/ErrorViewer/ErrorCache/error_cache = null
/datum/ErrorViewer/ErrorCache/showTo(var/user, var/datum/ErrorViewer/back_to, var/linear)
var/html = buildHeader(null, linear, refreshable=1)
html += "[total_runtimes] runtimes, [total_runtimes_skipped] skipped<br><br>"
html += "[GLOB.total_runtimes] runtimes, [GLOB.total_runtimes_skipped] skipped<br><br>"
if(!linear)
html += "organized | [makeLink("linear", null, 1)]<hr>"
var/datum/ErrorViewer/ErrorSource/error_source