mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Makes Travis fail PRs that runtime during init/unit testing.
This commit is contained in:
19
.travis.yml
19
.travis.yml
@@ -28,6 +28,25 @@ install:
|
|||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- shopt -s globstar
|
- shopt -s globstar
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
- (! grep 'step_[xy]' maps/**/*.dmm)
|
||||||
|
- (! grep -Pn '( |\t|;|{)tag( ?)=' maps/**/*.dmm)
|
||||||
|
- (! find nano/templates/ -type f -exec md5sum {} + | sort | uniq -D -w 32 | grep nano)
|
||||||
|
- (! grep -En "<\s*span\s+class\s*=\s*('[^'>]+|[^'>]+')\s*>" **/*.dm)
|
||||||
|
- awk -f tools/indentation.awk **/*.dm
|
||||||
|
- md5sum -c - <<< "88490b460c26947f5ec1ab1bb9fa9f17 *html/changelogs/example.yml"
|
||||||
|
- (num=`grep -E '\\\\(red|blue|green|black|b|i[^mc])' **/*.dm | wc -l`; echo "$num escapes (expecting ${MACRO_COUNT} or less)"; [ $num -le ${MACRO_COUNT} ])
|
||||||
|
- source $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}/byond/bin/byondsetup
|
||||||
|
- python tools/TagMatcher/tag-matcher.py ../..
|
||||||
|
# Run our test
|
||||||
|
- cp config/example/* config/
|
||||||
|
- echo "#define ${TEST_DEFINE} 1" > ${TEST_FILE}
|
||||||
|
- DreamMaker polaris.dme
|
||||||
|
- if [ $RUN -eq 1 ]; then DreamDaemon polaris.dmb -invisible -trusted -core 2>&1 | tee log.txt; fi
|
||||||
|
- if [ $RUN -eq 1 ]; then grep "All Unit Tests Passed" log.txt; fi
|
||||||
|
- if [ $RUN -eq 1 ]; then grep "Caught 0 Runtimes" log.txt; fi
|
||||||
|
>>>>>>> 40d5484... Merge pull request #6808 from Neerti/travis_runtime_checker
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./tools/travis/compile_and_run.sh
|
- ./tools/travis/compile_and_run.sh
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
// error_cooldown items will either be positive (cooldown time) or negative (silenced error)
|
// 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
|
// If negative, starts at -1, and goes down by 1 each time that error gets skipped
|
||||||
var/total_runtimes = 0
|
GLOBAL_VAR_INIT(total_runtimes, 0)
|
||||||
var/total_runtimes_skipped = 0
|
GLOBAL_VAR_INIT(total_runtimes_skipped, 0)
|
||||||
|
|
||||||
|
|
||||||
// The ifdef needs to be down here, since the error viewer references total_runtimes
|
// The ifdef needs to be down here, since the error viewer references total_runtimes
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
/world/Error(var/exception/e, var/datum/e_src)
|
/world/Error(var/exception/e, var/datum/e_src)
|
||||||
@@ -10,7 +12,7 @@ var/total_runtimes_skipped = 0
|
|||||||
return ..()
|
return ..()
|
||||||
if(!GLOB.error_last_seen) // A runtime is occurring too early in start-up initialization
|
if(!GLOB.error_last_seen) // A runtime is occurring too early in start-up initialization
|
||||||
return ..()
|
return ..()
|
||||||
total_runtimes++
|
GLOB.total_runtimes++
|
||||||
|
|
||||||
var/erroruid = "[e.file][e.line]"
|
var/erroruid = "[e.file][e.line]"
|
||||||
var/last_seen = GLOB.error_last_seen[erroruid]
|
var/last_seen = GLOB.error_last_seen[erroruid]
|
||||||
@@ -20,7 +22,7 @@ var/total_runtimes_skipped = 0
|
|||||||
last_seen = world.time
|
last_seen = world.time
|
||||||
if(cooldown < 0)
|
if(cooldown < 0)
|
||||||
GLOB.error_cooldown[erroruid]-- // Used to keep track of skip count for this error
|
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
|
return // Error is currently silenced, skip handling it
|
||||||
|
|
||||||
// Handle cooldowns and silencing spammy errors
|
// Handle cooldowns and silencing spammy errors
|
||||||
|
|||||||
@@ -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)
|
/datum/ErrorViewer/ErrorCache/showTo(var/user, var/datum/ErrorViewer/back_to, var/linear)
|
||||||
var/html = buildHeader(null, linear, refreshable=1)
|
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)
|
if(!linear)
|
||||||
html += "organized | [makeLink("linear", null, 1)]<hr>"
|
html += "organized | [makeLink("linear", null, 1)]<hr>"
|
||||||
var/datum/ErrorViewer/ErrorSource/error_source
|
var/datum/ErrorViewer/ErrorSource/error_source
|
||||||
|
|||||||
@@ -94,10 +94,10 @@ var/total_unit_tests = 0
|
|||||||
|
|
||||||
if(all_unit_tests_passed)
|
if(all_unit_tests_passed)
|
||||||
log_unit_test("[ASCII_GREEN]*** All Unit Tests Passed \[[total_unit_tests]\] ***[ASCII_RESET]")
|
log_unit_test("[ASCII_GREEN]*** All Unit Tests Passed \[[total_unit_tests]\] ***[ASCII_RESET]")
|
||||||
world.Del()
|
|
||||||
else
|
else
|
||||||
log_unit_test("[ASCII_RED]!!! \[[failed_unit_tests]\\[total_unit_tests]\] Unit Tests Failed !!![ASCII_RESET]")
|
log_unit_test("[ASCII_RED]!!! \[[failed_unit_tests]\\[total_unit_tests]\] Unit Tests Failed !!![ASCII_RESET]")
|
||||||
world.Del()
|
log_unit_test("Caught [GLOB.total_runtimes] Runtime\s.")
|
||||||
|
world.Del()
|
||||||
|
|
||||||
/datum/unit_test/proc/get_standard_turf()
|
/datum/unit_test/proc/get_standard_turf()
|
||||||
return locate(20,20,1)
|
return locate(20,20,1)
|
||||||
|
|||||||
Reference in New Issue
Block a user