GDScript: Allow tests to run on release builds

- Fix compilation issues by disabling warnings on release builds. This
  also strips warnings from expected result before the comparison to
  avoid false mismatches.
- Add a `#debug-only` flag to tests. Must be the first line of the test
  script. Those won't run with release builds. Can be used for test
  cases that rely on checks only available on debug builds.
This commit is contained in:
George Marques
2022-02-01 21:31:12 -03:00
parent ad6e2e82a9
commit b013c0d544
3 changed files with 44 additions and 1 deletions
@@ -1,3 +1,4 @@
#debug-only
func test():
var node := Node.new()
var inside_tree = node.is_inside_tree
@@ -2,5 +2,5 @@ GDTEST_RUNTIME_ERROR
>> SCRIPT ERROR
>> on function: test()
>> runtime/errors/callable_call_after_free_object.gd
>> 5
>> 6
>> Attempt to call function 'null::is_inside_tree (Callable)' on a null instance.