Fail tests if script error happens in Command Line Tool #250
-
We are running all unit test in our build pipeline with the command line tool with the following command:
Right now if a script error happens it displays "Enter "help" for assistance.", and the command does not terminate. Is it possible to configure that the cmd should exit and return -1 when a (GD-)script error happens (similar to the Script Error setting in the Settings Dialog in the Godot Editor)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello, I am back from vacation therefore the late answer. The script There is no need to use the provided script ;) e.g. remove the -d option, but than you will get no error line information for failing tests (Godot provides stacktrace info only on debug mode) |
Beta Was this translation helpful? Give feedback.
Hello, I am back from vacation therefore the late answer.
The script
./addons/gdUnit4/runtest.sh
runs the Godot engine with the debug option-d
, which leads to the described "breakpoint" in case of a script syntax or runtime error.There is no need to use the provided script ;)
Just as well you can call the tool manually in your CI script and adjust it to the desired options.
e.g. remove the -d option, but than you will get no error line information for failing tests (Godot provides stacktrace info only on debug mode)
$GODOT_BIN --path . -s ./addons/gdUnit4/bin/GdUnitCmdTool.gd -a tests/gdunit/