{"id":26094069,"url":"https://github.com/statismike/gd-rehearse","last_synced_at":"2025-04-12T09:34:08.327Z","repository":{"id":210114009,"uuid":"720548714","full_name":"StatisMike/gd-rehearse","owner":"StatisMike","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-03T20:18:15.000Z","size":1283,"stargazers_count":14,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-06T03:56:14.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StatisMike.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-18T20:23:46.000Z","updated_at":"2025-03-26T15:24:25.000Z","dependencies_parsed_at":"2024-03-05T07:41:22.293Z","dependency_job_id":"56e01650-2e71-48f2-bdfa-94f7435c4f3d","html_url":"https://github.com/StatisMike/gd-rehearse","commit_stats":null,"previous_names":["statismike/godot-test"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatisMike%2Fgd-rehearse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatisMike%2Fgd-rehearse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatisMike%2Fgd-rehearse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StatisMike%2Fgd-rehearse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StatisMike","download_url":"https://codeload.github.com/StatisMike/gd-rehearse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248546493,"owners_count":21122329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-09T12:49:37.547Z","updated_at":"2025-04-12T09:34:08.290Z","avatar_url":"https://github.com/StatisMike.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gd-rehearse\n![Tests](https://github.com/StatisMike/gd-rehearse/actions/workflows/tests.yaml/badge.svg)\n\n\u003eIn the vibrant production of game development, testing serves as the ongoing rehearsals where every line of code steps onto the stage. Just as actors grasping for fame polish their performances before the grand opening night, game makers of all calibers should fine-tune their creation, ensuring a flawless gameplay experience when the curtain rises on the final release.\n\nThis crate enhances the testing capabilities of [godot-rust](https://github.com/godot-rust/gdext) projects, enabling unit \nand integration testing as well as benchmarking.\n\nWhen using the standard `#[test]` Rust macro in a gdextension project, tests will fail if they involve objects that require the Godot executable to run. `gd-rehearse` provides a suitable testing stage by introducing the `#[gditest]` and `#[gdbench]` macros. These can be used to annotate functions intended for testing or benchmarking your code, and the crate provides the GdTestRunner for executing them within a created Godot test scene.\n\n## In Development\n\n⚠️ **This crate is not production-ready.**\n\nThe API is still in early development and may undergo changes. Contributions, discussions, and feedback are highly encouraged.\n\n## Output\n\nEvery execution of `GdTestRunner` generates output, appearing in the terminal when run from the command line in headless mode \nor in the Godot console when executed from the editor. The output resembles the example below:\n\n```\n$ godot --path tests/godot/ --headless\nInitialize godot-rust (API v4.2.stable.official, runtime v4.2.stable.official)\nGodot Engine v4.2.stable.official.46dc27791 - https://godotengine.org\n\n--------------------------------------------------------------------------------\n--------------------          Running gd-rehearse           --------------------\n--------------------------------------------------------------------------------\n              Began run in HEADLESS mode in scene: res://test.tscn              \n                     Rust build: debug; Godot build: debug                      \n                              disallowing focused                               \n\n   Found 6 Rust tests in 1 files\n   Found 3 Rust benchmarks in 1 files\n\n--------------------------------------------------------------------------------\n   Running Rust tests\n--------------------------------------------------------------------------------\n\n   itest.rs:\n   -- simple_test ... ok!\n   -- second_test ... ok!\n   -- focused_test ... ok!\n   -- skipped_test ... ~skipped~\n   -- filter_me ... ok!\n   -- filter_me_too ... ok!\n\nTests result: ok! 5 passed; 0 failed, 1 skipped. Elapsed: 0.00s.\n\n--------------------------------------------------------------------------------\n   Running Rust benchmarks\n--------------------------------------------------------------------------------\n                                              min       median\n   bench.rs:\n   -- focused_bench              ...      0.015μs      0.016μs\n   -- skipped_bench              ...    ~skipped~\n   -- normal_bench               ...      0.016μs      0.020μs\n\nBenchmarks result: ok! 2 passed; 0 failed, 1 skipped. Elapsed: 0.00s.\n\n= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = \n = = = = = = = = = =             ! SUCCESS !               = = = = = = = = = =\n= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\n```\n\nOr for fans of straight to the point, commandline option `--quiet-run` can be used:\n\n```\n$ godot --path tests/godot/ --headless -- --quiet-run\nInitialize godot-rust (API v4.2.stable.official, runtime v4.2.stable.official)\nGodot Engine v4.2.stable.official.46dc27791 - https://godotengine.org\n \nTests result: ok! 5 passed; 0 failed, 1 skipped. Elapsed: 0.00s.\nBenchmarks result: ok! 2 passed; 0 failed, 1 skipped. Elapsed: 0.00s.\n```\n\n## Setup\n\nTo run tests and benchmarks, the macros alone are not sufficient. You need to create a Godot project using your `gdext` \nextension. This project should contain a scene with a `GdTestRunner` node as the base node - so additional scene if you \nare creating a Godot application. If you're developing a `gdext` extension, you need to have a minimal Godot project inside your \ncrate's workspace. You can find an example of the implementation in the `tests` directory of this repo.\n\nAfter setting up the scene, you can run it from the Godot editor or the command line. Refer to the `GdTestRunner` documentation \nfor additional information.\n\n\u003e ⚠️ While running tests from the editor, if the full runner run is very short the output won't always get printed to Godot\nconsole.\n\n## GitHub CI hints\n\nTo setup `gd-rehearse` in Github Actions, remember to include `.godot/extension_list.cfg` at minimal inside your Godot project. \nEven though Godot 4+ includes whole `.godot` directory as ignored, without this file commandline Godot run won't be able to \nfind your `*.gdextension` file, thus not loading the `GdTestRunner`. \n\n## Note\n\nThe functionality of this crate is heavily inspired by the [internal tests of `godot-rust`](https://github.com/godot-rust/gdext/tree/master/itest), \nand core portions of source code are borrowed from there. Big thanks to maintainers and contributors of `godot-rust`!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatismike%2Fgd-rehearse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatismike%2Fgd-rehearse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatismike%2Fgd-rehearse/lists"}