DEV.co
Open-Source Testing · godot-gdunit-labs

gdUnit4

GdUnit4 is an embedded unit testing framework for Godot 4 that lets you write and run tests directly in the editor for GDScript and C# code. It supports test-driven development with features like mocking, scene testing, and CI/CD integration.

Source: GitHub — github.com/godot-gdunit-labs/gdUnit4
1.1k
GitHub stars
67
Forks
GDScript
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorygodot-gdunit-labs/gdUnit4
Ownergodot-gdunit-labs
Primary languageGDScript
LicenseMIT — OSI-approved
Stars1.1k
Forks67
Open issues11
Latest releasev6.1.3 (2026-04-27)
Last updated2026-07-03
Sourcehttps://github.com/godot-gdunit-labs/gdUnit4

What gdUnit4 is

GdUnit4 provides a fluent assertion API, parameterized/fuzzy testing, scene runner for input simulation, mock/spy capabilities, and command-line tooling for CI pipelines. It integrates tightly with Godot 4.3–4.7.1-rc1 and generates JUnit XML and HTML reports.

Quickstart

Get the gdUnit4 source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/godot-gdunit-labs/gdUnit4.gitcd gdUnit4# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Game logic unit testing in Godot projects

Test game mechanics, player controllers, and utility functions using fluent assertions and parameterized tests before integration into scenes.

Automated scene and input testing

Verify scene behavior under simulated mouse, keyboard, and touch inputs using the built-in SceneRunner without manual play-testing.

CI/CD test automation for Godot games

Run test suites in CI pipelines via command-line tool, generate JUnit XML/HTML reports, and integrate with GitHub Actions for automated quality gates.

Implementation considerations

  • Requires compatible Godot version (v6.1.3 supports v4.5–v4.6.3; master branch supports v4.7.1-rc1). Pin version compatibility early.
  • C# support requires separate gdUnit4Net package and VSTest adapter setup; GDScript tests work out-of-box in editor.
  • Scene testing via SceneRunner requires understanding of Godot's input event system and signal propagation for accurate test logic.
  • Flaky test retry configuration and fuzzing parameters should be tuned per project to balance coverage and test execution time.
  • Test templates are customizable but require understanding GdUnit4's code generation conventions.

When to avoid it — and what to weigh

  • You need tests for Godot 3.x projects — GdUnit4 only supports Godot 4.x. Legacy Godot 3 projects require a different testing solution or migration.
  • You require a non-permissive commercial license — MIT license permits commercial use, but any custom modifications to the framework itself remain under MIT. Verify alignment with your IP strategy.
  • Your team has no GDScript or C# experience — The framework assumes familiarity with GDScript/C# and Godot conventions. Steep learning curve without prior Godot exposure.
  • You need performance or load testing at scale — GdUnit4 is optimized for unit and integration tests, not large-scale load or stress testing scenarios.

License & commercial use

MIT License (MIT). Permissive open-source license allowing use, modification, and distribution in proprietary and commercial projects, with preservation of copyright notice and license text.

MIT license permits commercial use of GdUnit4 without royalties or licensing fees. However, any modifications to the framework itself remain under MIT. Verify internal IP policies if you plan to fork or extensively customize the codebase. For third-party integration or support, consult the Patreon or contact maintainers directly.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No exploit details provided. GdUnit4 is a testing framework operating within the Godot editor and game runtime—it does not expose external network services or handle sensitive data inherently. Verify that test fixtures and mocks do not inadvertently leak credentials or secrets; standard code review practices apply. No known CVEs reported in data.

Alternatives to consider

Gut (Godot Unit Test)

Earlier Godot testing framework; lighter weight but less feature-rich (fewer assertions, no built-in mocking). Suitable for simpler test suites or legacy Godot 3.x projects.

UT.Boom (Godot 4)

Minimal, zero-dependency test framework for Godot 4. Faster setup and smaller footprint; trade-off is manual assertion writing and fewer conveniences.

WAT (Godot Add-on)

Another Godot testing framework with different assertion syntax and scene testing approach. Community-supported but less active than GdUnit4.

Software development agency

Build on gdUnit4 with DEV.co software developers

GdUnit4 integrates directly into the Godot editor and supports your full development workflow—from TDD to CI/CD. Start with the official documentation or explore community examples on GitHub.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

gdUnit4 FAQ

Does GdUnit4 work with Godot 3.x?
No. GdUnit4 is designed exclusively for Godot 4.x (v4.3 and later). Use Gut or other frameworks for Godot 3.
Can I run tests outside the Godot editor?
Yes. GdUnit4 includes a command-line tool for CI/CD pipelines. It generates JUnit XML and HTML reports for integration with external systems.
What is the difference between mocking and spying?
Mocking creates a fake object with predefined behavior; spying wraps a real object to verify its methods were called. GdUnit4 supports both for unit and scene testing.
Is GdUnit4 suitable for performance/load testing?
No. GdUnit4 is optimized for unit and functional testing. For performance profiling, use Godot's built-in profiler or external benchmarking tools.

Custom software development services

DEV.co helps companies turn open-source tools like gdUnit4 into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source testing stack.

Ready to add testing to your Godot project?

GdUnit4 integrates directly into the Godot editor and supports your full development workflow—from TDD to CI/CD. Start with the official documentation or explore community examples on GitHub.