Skip to content

Conversation

@nchapman
Copy link
Collaborator

@nchapman nchapman commented Nov 9, 2025

Added tests that need mocks and integration tests. This involves a lot of refactoring to make the code more testable. During review we need to be extra mindful of not regressing any features.

@nchapman nchapman requested a review from Copilot November 9, 2025 05:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR significantly improves MinUI's codebase architecture by extracting logic from monolithic files into reusable, testable modules. The main focus is on improving testability by separating pure logic from SDL/platform dependencies and adding comprehensive unit test coverage.

Key Changes:

  • Extracted data structures (Array, Hash) from minui.c to collections.c for reusability
  • Separated input handling logic (PAD_*) from api.c to pad.c for isolated testing
  • Moved text rendering utilities (GFX_*) from api.c to gfx_text.c
  • Created parsers for various file formats (M3U, map.txt, recent.txt, collections)
  • Added path generation utilities and binary file I/O helpers
  • Implemented comprehensive unit tests with mocking support (fff framework, file system mocks)
  • Updated makefiles to include new source files in builds

Reviewed Changes

Copilot reviewed 63 out of 66 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
workspace/all/common/collections.{c,h} Extracted Array and Hash data structures for reusability
workspace/all/common/pad.{c,h} Separated input state management from SDL dependencies
workspace/all/common/gfx_text.{c,h} Extracted text rendering utilities for testing
workspace/all/common/*_parser.{c,h} New parsers for M3U, map.txt, collections, recent.txt files
workspace/all/common/minui_*.{c,h} Helper utilities and file checking functions
workspace/all/common/minarch_paths.{c,h} Path generation for save files
workspace/all/common/audio_resampler.{c,h} Audio resampling algorithm extraction
workspace/all/common/binary_file_utils.{c,h} Binary file I/O utilities
workspace/all/common/api.c Removed extracted code, added includes for new modules
workspace/all/minui/minui.c Removed data structures now in collections.c
workspace/all/*/makefile Updated to include new source files in compilation
tests/unit/all/common/test_*.c Comprehensive unit tests for all new modules
tests/support/* Testing infrastructure (SDL stubs, fakes, mocks)
tests/integration/integration_support.{c,h} Support utilities for integration tests
makefile* Documentation improvements and qa target fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nchapman nchapman merged commit 8e2c0bf into main Nov 9, 2025
3 checks passed
@nchapman nchapman deleted the moar-tests branch November 9, 2025 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants