From 7b4254d75d5cf03eea106a0a07b390992d5a2e06 Mon Sep 17 00:00:00 2001 From: caryoscelus Date: Tue, 30 Aug 2016 22:45:51 +0300 Subject: [PATCH 1/2] fix command line option parser perhaps related to Godot API update --- test/gut/gut_cmdln.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/gut/gut_cmdln.gd b/test/gut/gut_cmdln.gd index cb40ec7d..6b9b4efd 100644 --- a/test/gut/gut_cmdln.gd +++ b/test/gut/gut_cmdln.gd @@ -50,7 +50,7 @@ class CmdLineParser: func _init(): for i in range(OS.get_cmdline_args().size()): - _opts.append(OS.get_cmdline_args().get(i)) + _opts.append(OS.get_cmdline_args()[i]) # Search _opts for an element that starts with the option name # specified. From 9ca40330bf35b2dd2e30b030fee661c7da6a8256 Mon Sep 17 00:00:00 2001 From: caryoscelus Date: Tue, 30 Aug 2016 22:53:29 +0300 Subject: [PATCH 2/2] return non-zero exit code on failing tests this is done in a hacky way currently, since Godot doesn't seem to support proper exit code specification. killing self process is used to achieve this instead --- test/gut/gut_cmdln.gd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/gut/gut_cmdln.gd b/test/gut/gut_cmdln.gd index 6b9b4efd..431a02e0 100644 --- a/test/gut/gut_cmdln.gd +++ b/test/gut/gut_cmdln.gd @@ -339,4 +339,8 @@ func _init(): # exit if option is set. func _on_tests_finished(): if(options.should_exit): - quit() + if(_tester._summary.failed>0): + # kill self => return non-zero exit code + OS.kill(OS.get_process_ID()) + else: + quit()