Skip to content

Add off-device unit tests for pure-logic classes #2

Description

@jonfroehlich

Now that compile CI exists (#1), the higher-value testing layer is unit-testing the classes whose logic is hardware-independent. This naturally belongs in this repo rather than the arduino repo.

Candidates (no hardware needed)

  • MovingAverageFilter — sliding-window average, isWindowFull() behavior.
  • Shape / Circle / Rectangle / Ball — bounding-box & radial collision math, containment, boundary clamping.
  • ColorName — nearest-color (MSE) matching.

Decisions to make

  • Framework: host build with GoogleTest + ArduinoFake to stub Arduino.h, vs. AUnit on an emulator. Recommend GoogleTest + ArduinoFake for fast, hardware-free ubuntu-latest runs.
  • Layout: a test/ dir + CMake, wired into a new CI job.

Acceptance

  • Tests run on push/PR in GitHub Actions (separate job from the compile workflow).
  • Coverage for the three classes above.

Tracking follow-up from #1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions