#Simple test Harness : unit testing framework for Godot 4

13 messages · Page 1 of 1 (latest)

hushed crescent
#

Hi !

To develop my addons, I needed a unit test framework, compatible with Godot 4 ! There exists multiple test frameworks, but, since I'm a bit insane, I decided to create mine, as a challenge !

So here is **STH **: a simple but powerful test harness for Godot 4. The aim is to provide documentation, API and tools to write and run unit or integration tests, with Godot Editor full integration.

First alpha has been released, second alpha is on its way providing more assertions ! I will develop missing functionalities in next few weeks, like spy, mock, scene tree emulator, ...

Any advice/feedback is appreciate 👍.

I will update thread to answer questions, or to post updates 😉

See you soon !

*Github *: https://github.com/AdrienQuillet/godot-simple-test-harness

GitHub

A simple (yet powerful) test harness to write and run unit tests for Godot Engine - GitHub - AdrienQuillet/godot-simple-test-harness: A simple (yet powerful) test harness to write and run unit test...

rough wagon
#

nice looks like a clone of my GdUnit4 plugin 😉

hushed crescent
#

I don't know if it's a clone or not 🙂
As a Java developer, I really like IDE integration with major unit test frameworks : JUnit, AssertJ, Mockito. Since Godot Editor has no official way to write unit tests, I feel like replicating my favorite development environment would be helpful to write unit tests using GDScript

rough wagon
hushed crescent
#

Still missing the Coverage feature, but it looks like kinda hard to code and integrate in Godot Editor (AST > generate instrumented copied GDScript > merge with AST > result ? Seems painful but...)

rough wagon
#

it has all mock, spy ui integration xml report ci integration

#

code coverage is a feature planed after GdUnit4 is fully migrated 😉

hushed crescent
#

Ahah nice ! 😎

rough wagon
#

i have an idea how to implement the code coverage, but i'm current working to stabilize the plugin

#

also c# support needs to be reworked

hushed crescent
rough wagon
#

on GdUnit3 there is a c# extension, to run/debug Godot c# with GdUnit

hushed crescent
#

Ow that's nice !