GitHub Vita Lite - Wolff's Store
Code / README | Releases | Issues
WolffsRoom/godot4-psvita / modules / gdscript / tests

Files

TypeFilenameSize
DIRscripts—
FILEgdscript_test_runner.cpp24562 B
FILEgdscript_test_runner.h5148 B
FILEgdscript_test_runner_suite.h8628 B
FILEREADME.md3949 B
FILEtest_completion.h9948 B
FILEtest_gdscript.cpp13457 B
FILEtest_gdscript.h2440 B
FILEtest_lsp.h23306 B

README

GDScript integration tests

The scripts/ folder contains integration tests in the form of GDScript files and output files.

See the Integration tests for GDScript documentation for information about creating and running GDScript integration tests.

GDScript Autocompletion tests

The scripts/completion folder contains tests for the GDScript autocompletion.

Each test case consists of at least one .gd file, which contains the code, and one .cfg file, which contains expected results and configuration. Inside of the GDScript file the character ➡ represents the cursor position, at which autocompletion is invoked.

The script files won't be parsable GDScript since it contains an invalid char and often the code is not complete during autocompletion. To allow for a valid base when used with a scene, the runner will remove the line which contains ➡. Therefore the scripts need to be valid if this line is removed, otherwise the test might behave in unexpected ways. This may for example require adding an additional pass statement.

This also means, that the runner will add the script to its owner node, so the script should not be loaded through the scene file.

The config file contains two section:

[input] contains keys that configure the test environment. The following keys are possible:

[output] specifies the expected results for the test. The following key are supported:

Tests will only test against entries in [output] that were specified.

Writing autocompletion tests

To avoid failing edge cases a certain behavior needs to be tested multiple times. Some things that tests should account for: