Set non-zero exit code if tests fail

This commit is contained in:
Leroy Hopson 2023-01-26 07:04:19 +13:00
parent 98b42733fb
commit 7ac180d431
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA

View file

@ -44,6 +44,7 @@ var Gut = load("res://addons/gut/gut.gd")
var GutRunner = load("res://addons/gut/gui/GutRunner.tscn")
var json = JSON.new()
var exit_code = 0
# ------------------------------------------------------------------------------
@ -390,15 +391,13 @@ func _on_tests_finished(should_exit, should_exit_on_success):
set_exit_code(post_inst.get_exit_code())
if should_exit or (should_exit_on_success and _tester.get_fail_count() == 0):
quit()
quit(exit_code)
else:
print("Tests finished, exit manually")
func set_exit_code(val):
pass
# OS.exit_code doesn't exist anymore, but when we find a solution it just
# goes here.
exit_code = val
# ------------------------------------------------------------------------------