virtualx-engine/modules/gdscript
George Marques 5f77f38573
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>
2021-04-08 09:34:59 -03:00
..
doc_classes doc: Sync classref with current source 2021-01-04 14:33:44 +01:00
editor Improve resource load cache 2021-02-11 15:44:28 -03:00
icons Optimize SVG using svgcleaner --multipass 2020-10-25 10:02:37 +01:00
language_server Merge pull request #40276 from Taywee/master 2021-02-25 17:26:26 +01:00
tests Add runner for GDScript testing 2021-04-08 09:34:59 -03:00
config.py Unregister GDScriptFunctionState class 2020-11-26 21:39:54 -03:00
gdscript.cpp Add runner for GDScript testing 2021-04-08 09:34:59 -03:00
gdscript.h Improve resource load cache 2021-02-11 15:44:28 -03:00
gdscript_analyzer.cpp Merge pull request #47131 from vnen/gdscript-export-fix 2021-03-30 15:12:04 +02:00
gdscript_analyzer.h Move GDSript annotation application after type-checking 2021-03-30 08:29:36 -03:00
gdscript_byte_codegen.cpp Merge pull request #47569 from vnen/gdscript-typed-return 2021-04-05 15:16:43 +02:00
gdscript_byte_codegen.h Style: Apply clang-tidy's readability-braces-around-statements 2021-04-05 14:09:59 +02:00
gdscript_cache.cpp Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
gdscript_cache.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
gdscript_codegen.h Add typed arrays to GDScript 2021-03-29 10:45:48 -03:00
gdscript_compiler.cpp Fix GDScript variables addresses getting mixed 2021-04-04 19:03:15 +02:00
gdscript_compiler.h Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
gdscript_disassembler.cpp Merge pull request #47569 from vnen/gdscript-typed-return 2021-04-05 15:16:43 +02:00
gdscript_editor.cpp Style: Apply clang-tidy's modernize-use-nullptr 2021-04-05 14:05:07 +02:00
gdscript_function.cpp Fixes small typos and grammar correction 2021-03-12 19:05:16 +05:30
gdscript_function.h GDScript: Properly validate return type 2021-04-05 09:52:05 -03:00
gdscript_parser.cpp GDScript: Implement export of typed arrays 2021-03-30 08:29:38 -03:00
gdscript_parser.h GDScript: Allow export of enum variables 2021-03-30 08:29:38 -03:00
gdscript_tokenizer.cpp Fix missing quote in multiline GDScript string 2021-03-19 01:24:18 +01:00
gdscript_tokenizer.h Initialize class/struct variables with default values in modules/ 2021-02-08 10:57:18 +01:00
gdscript_utility_functions.cpp Rename Array.invert() to Array.reverse() 2021-03-21 10:20:08 +00:00
gdscript_utility_functions.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
gdscript_vm.cpp GDScript: Properly validate return type 2021-04-05 09:52:05 -03:00
gdscript_warning.cpp Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
gdscript_warning.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
register_types.cpp Add runner for GDScript testing 2021-04-08 09:34:59 -03:00
register_types.h Update copyright statements to 2021 2021-01-01 20:19:21 +01:00
SCsub Register GDScript test tools as test commands to run via command-line 2020-09-02 01:43:26 +03:00