Skip to content

Commit f373531

Browse files
committed
tests: Document using the GUT CLI
https://phabricator.endlessm.com/T35508
1 parent 7335216 commit f373531

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

addons/block_code/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,20 @@ Now `pre-commit` will run automatically on `git commit`!
7171
### Testing
7272

7373
This plugin uses the [Godot Unit Test](https://gut.readthedocs.io/en/latest/) (GUT) plugin for testing. In the editor, select the **GUT** tab in the bottom panel to open the test panel. Then select **Run All** to run the tests.
74+
75+
Tests can also be run from the command line using the GUT command line script:
76+
77+
```
78+
godot --path . --headless --script addons/gut/gut_cmdln.gd -gexit
79+
```
80+
81+
A few options are of note here. `--path` instructs Godot to use the project in
82+
the current directory. `--headless` instructs Godot to run without a display or
83+
sound. `--script` instructs Godot to run the GUT command line script instead of
84+
running the main scene. `-gexit` is an option for the GUT command line script
85+
that instructs GUT to exit after the tests complete.
86+
87+
There are several other GUT command line options for running specific tests.
88+
For example, `-gtest=path/to/test_script_1.gd,path/to/test_script_2.gd` can be
89+
used to run specific test scripts. A specific test function can be specified
90+
with `-gunit_test_name=test_to_run`.

0 commit comments

Comments
 (0)