From 7ac180d431899b974a1f0cb072b1639e758b8506 Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Thu, 26 Jan 2023 07:04:19 +1300 Subject: [PATCH] Set non-zero exit code if tests fail --- addons/gut/gut_cmdln.gd | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/gut/gut_cmdln.gd b/addons/gut/gut_cmdln.gd index fcd615c..b0af74e 100644 --- a/addons/gut/gut_cmdln.gd +++ b/addons/gut/gut_cmdln.gd @@ -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 # ------------------------------------------------------------------------------