Skip to content

Create Reference Test Plugin and Core Test Suite #350

Description

@maxolasersquad

Objective

Build a reference test plugin and a test suite in doctest to validate the plugin engine lifecycle and hardware interactions.

Scope & Requirements

  • Implement a minimal C99 plugin in tests/plugins/TestPlugin.cpp:
    • Exports plugin_query_abi_version() and valid manifest
    • Implements initialize() and shutdown()
    • Implements get_config_schema() and configure()
    • Implements a dummy slot peripheral card tracking I/O read/write counts
    • Implements on_frame_ready and on_reset event hooks
  • Add a CMake shared library target for the reference plugin.
  • Implement unit and integration tests in tests/unit/test_plugin_system.cpp registered in ctest.

Testing & Verification

  • Build the reference plugin shared library target during test suite compilation.
  • Execute ctest --test-dir build -R test-plugin-system to validate complete end-to-end plugin operations.
  • Validate version handshake acceptance and rejection of mismatched ABI versions.
  • Validate host bridge memory peek/poke, cycle queries, and OSD message delivery through the reference plugin.
  • Validate directory scanning and manifest extraction without initialization.
  • Validate event hook execution across frame, memory, and reset events.
  • Validate slot insertion, I/O read/write routing, IRQ trigger, and card ejection.
  • Validate passing key-value options via configure() and retrieving updated plugin state.
  • Verify clean memory management across multiple load and unload cycles using memory check tools.

Acceptance Criteria

  • test-plugin-system target builds and passes in ctest.
  • Reference plugin compiles as an isolated shared library without warnings.
  • Zero memory leaks or dangling handles detected during test runs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

sdl3Affects the SDL3 frontend.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions