summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.gd
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2021-04-07 10:12:51 -0300
committerGeorge Marques <george@gmarqu.es>2021-04-08 09:34:59 -0300
commit5f77f38573a8127e50946169e01b5ee09cfc1c96 (patch)
tree7552c5cba79bbc11bb1998f9303de53a302e3c2c /modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.gd
parent47aef8e8dcc61b505777a84e31a507ee555d188f (diff)
Add runner for GDScript testing
This is meant for testing the GDScript implementation, not for testing user scripts nor testing the engine using scripts. Tests consists in a GDScript file and a .out file with the expected output. The .out file format is: expected status (based on the enum GDScriptTest::TestStatus) on the first line, followed by either an error message or the resulting output. Warnings are added after the first line, before the output (or compiler errors) if the parser pass without any error. The test script must have a function called `test()` which takes no argument. Such function will be called by the test runner. The test should not have any dependency unless it's part of the test too. Global classes (using `class_name`) are registered before the runner starts, so those should work if needed. Use the command `godot --gdscript-generate-tests godot-source/modules/gdscript/tests/scripts` to update the .out files with the current output (make sure the output are the expected values before committing). The tests themselves are part of the doctest suite so those can be executed with `godot --test`. Co-authored-by: Andrii Doroshenko (Xrayez) <xrayez@gmail.com>
Diffstat (limited to 'modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.gd')
-rw-r--r--modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.gd6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.gd b/modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.gd
new file mode 100644
index 0000000000..116b0151da
--- /dev/null
+++ b/modules/gdscript/tests/scripts/parser-errors/missing-paren-after-args.gd
@@ -0,0 +1,6 @@
+func args(a, b):
+ print(a)
+ print(b)
+
+func test():
+ args(1,2