| title | Getting started |
|---|---|
| description | Install the framework, write a first suite, run it, and wire CI. |
| order | 10 |
| sidebar | Basics |
| draft | false |
This page walks you from an empty repository to a green test run.
| Tool | Notes |
|---|---|
| Godot 4.5 binary | Any 4.5 build. The CLI discovers it automatically. Pass --godot to be explicit. |
| SCons | The build system. Install with python3 -m pip install scons. |
| C++20 toolchain | GCC, Clang, or MSVC. Coroutines need C++20. |
| Python 3 | Runs the gdextest CLI. |
Your repository already vendors godot-cpp (every GDExtension does). The framework reuses your copy. The framework submodule's own nested godot-cpp is used only by the framework's self-tests.
git submodule add <this-repo-url> extern/gdextest
git submodule update --initRun every command in this guide from your repository root. The CLI is the gdextest script inside the submodule.
Create tests/smoke.cpp:
#include "gdextest/assert.h"
#include "gdextest/registry.h"
GDEX_TEST(smoke, framework_is_wired) {
GDEX_EXPECT(true);
}Suites are plain C++ files. Every test body receives a TestContext& named ctx, so the assertion macros find it by name. See Writing tests for the full macro set.
./extern/gdextest/gdextest testOne command does everything:
- Writes
.gdextest.tomlwhen the file does not exist. It never overwrites an existing config. - Runs the doctor preflight: config validity, Godot, SCons, godot-cpp version, and test source discovery.
- Builds the test library with SCons. When your
SConstructdoes not call the framework SConscript yet, the build runs through a temporary injected copy. Your build file is never modified. - Generates the fixture Godot project and warms its cache on the first run.
- Launches Godot headless, runs the suites, prints the summary, and quits.
- Removes the disposable fixture. Only the test library and your result files remain.
Exit codes: 0 all tests passed, 1 at least one failed or crashed, 2 usage or environment error.
Add --json=results.json for machine-readable results. See CLI reference.
gdextest test works without touching your SConstruct. Two commands make the wiring permanent and generate a starting entry point:
./extern/gdextest/gdextest scaffold --applyThis patches SConstruct (a .bak backup is written first) and generates testsupport/entry.cpp plus a smoke suite from your config values. Run plain gdextest scaffold first to preview the changes without applying them.
./extern/gdextest/gdextest init --ciThis writes .github/workflows/gdextest.yml. The workflow installs SCons, downloads Godot 4.5, and runs gdextest test. For parallel runs use shards and merge the results:
./extern/gdextest/gdextest test --shard=0/4 --json=shard0.json
./extern/gdextest/gdextest report 'shard*.json' --json=merged.json --junit=merged.xmlreport exits 1 when any merged test failed, so the merge step is also a gate. See CLI reference for the complete flag list and Consumer guide for CI recipes.
- Writing tests — assertions, tags, teardowns, and resource tracking.
- Async tests — suspend a test across engine frames.
- Engine integration — reach the live engine and monitor signals.
- Consumer guide — build wiring, adapters, custom entry points and fixtures.