Add GdUnit4 testing framework with comprehensive test coverage

- Add GdUnit4 v6.2.1 framework in addons/gdUnit4/
- Create test directory structure (tests/unit/, tests/integration/, tests/mocks/)
- Add unit tests for MusicPlayer.gd (8 tests)
- Add unit tests for MainWindow.gd (15+ tests)
- Add unit tests for Settings.gd (5 tests)
- Add unit tests for Playlist.gd (11 tests)
- Add integration tests for full flow (10+ tests)
- Add MockHTTPRequest for HTTP request mocking
- Add TestHelpers with utility functions
- Add Gitea Actions CI workflow (.gitea/workflows/test.yml)
- Add .runsettings for GdUnit4 CLI configuration
- Add run_tests.sh for convenient test execution
- Add TESTING.md with comprehensive documentation
- Add TESTING_PLAN.md with implementation details
- Update .gitignore for test artifacts
- Enable GdUnit4 plugin in project.godot

Features:
- Test button functionality (play, pause, search, sync, etc.)
- Mock REST API requests to server
- Test complete application flows
- Run tests in CI (headless mode)
- Run tests in GUI for visual feedback
- JUnit XML and HTML test reports

Generated by OpenCode AI assistant.
This commit is contained in:
Sansan committed 2026-10-01 20:55:09 +02:00
1 parent 8da6fc442f
commit 4a275e6a88
15 files changed
+2146 -1

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
class_name BasicTest
extends GdUnitTestSuite
func test_true_is_true():
assert_true(true)
func test_false_is_false():
assert_false(false)
func test_one_equals_one():
assert_eq(1, 1)
func test_arrays_work():
var arr = [1, 2, 3]
assert_eq(arr.size(), 3)
assert_eq(arr[0], 1)
func test_dictionaries_work():
var dict = {"key": "value", "number": 42}
assert_eq(dict["key"], "value")
assert_eq(dict["number"], 42)