Skip to content

GdUnit ​

The GdUnit host is a .NET test executable that runs GDScript suites in a private copy of your game with embedded libgodot. It supports pure GDScript games and scenes containing C# components.

Illus. Moritz Voss: a white anthro dog in a hacker hoodie and their robot dog sniffing the ground

Create a host from the game directory:

bash
dnx 2dog add --gdunit

Or select GdUnit in the interactive host picker. The generated host includes a sample GDScript test and its MTP runner configuration. See the GdUnit configuration guide for customization. Run from the project root:

bash
dotnet test MyGame.gdunit

The root global.json that 2dog creates selects MTP for dotnet test. With a root global.json of your own that does not, run from MyGame.gdunit/.

Use GdUnit's official documentation to write tests. Testing with GdUnit explains the 2dog-specific execution and reporting differences.

2dog is Free and Libre Open Source under the MIT License.
2dog is not affiliated with or endorsed by the Godot Foundation.
Godot is licensed under the MIT License. @icons made by Voxy under the MIT License.
Continuous Integration compute graciously supported by RunsOn.