Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unit tests #6

Open
limbonaut opened this issue Oct 29, 2024 · 0 comments
Open

Add unit tests #6

limbonaut opened this issue Oct 29, 2024 · 0 comments
Assignees
Labels

Comments

@limbonaut
Copy link
Collaborator

limbonaut commented Oct 29, 2024

As discussed in #5, we need to decide how to approach testing.

There are at least two testing frameworks for GDScript. Tests can be implemented in GDScript within a Godot project using a testing framework addon. Such tests could be placed in the demo project or in a separate project dedicated to testing. The main advantage of this approach is that it executes code via GDScript - just like users would - and provides API usage examples. This setup makes it easier to verify if we're breaking the public API.

Another option is to use one of the C++ testing frameworks. Godot Engine already uses the C++ doctest framework, and any Godot module can add its own tests. If we add an option to build Sentry SDK as a Godot module, we could also add tests using this framework. Example: https://github.com/limbonaut/limboai/tree/master/tests. The advantages of this approach include no extra dependencies, and the ability to test internal things that are not part of the public API. However, sentry-godot can't currently be compiled as an engine module, and it would require some work to port. Such tests are compiled with the engine (using a specific build option) and can be executed via a CLI option, like so: godot --test --tc="*[SOME_TEST_GROUP]*"

We need #16 for CI integration.

@limbonaut limbonaut added the enhancement New feature or request label Oct 29, 2024
@limbonaut limbonaut moved this to Todo in GDX Oct 29, 2024
@limbonaut limbonaut moved this from Todo to In Progress in GDX Nov 14, 2024
@limbonaut limbonaut self-assigned this Nov 14, 2024
@limbonaut limbonaut added testing and removed enhancement New feature or request labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress
Development

No branches or pull requests

1 participant