Skip to content

Implement initial test runner / CI build test - #13

Merged
drasticactions merged 8 commits into
masterfrom
dev/timill/test-runner
Jul 1, 2026
Merged

drasticactions merged 8 commits into
masterfrom
dev/timill/test-runner

Conversation

@drasticactions

Copy link
Copy Markdown
Contributor

This adds an initial test runner and CI test workflow for NImpeller

  • It runs on llvmpipe (or theoretically another software GL instance). This is so it can be consistent (since it should always be the same running through that than whatever hardware GL you happen to have) and because running this against Nvidia EGL on my machine would segfault on some of the tests in its drivers. That requires further investigation on my part, but it's not Impeller/NImpeller-related AFAIK.
  • It's broken down into two parts: Binding tests that exercise the library and don't render UI, and "Golden" tests (Flutter's term) that render out to PNGs that are rendered out as part of the first run, then stored and verified against for the future. They were based on their unit tests, the idea being that as we increase our binding support, we can match what they render to, since there shouldn't be any difference between using our bindings and using their engine directly.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an initial automated test harness for NImpeller, including a headless software-GL renderer for deterministic golden-image regression tests, and wires it into GitHub Actions CI on Ubuntu.

Changes:

  • Introduces a new tests/NImpeller.Tests xUnit v3 test project with unit tests plus headless GL-based rendering/golden tests.
  • Adds a deterministic “golden scenes” suite and baseline image storage/compare utilities.
  • Adds a CI workflow to install Mesa/llvmpipe + SDL deps, generate bindings, and run tests under Xvfb.

Reviewed changes

Copilot reviewed 20 out of 44 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/NImpeller.Tests/Unit/StructHelperTests.cs Adds unit tests for struct helpers and conversions.
tests/NImpeller.Tests/Unit/PathBuilderTests.cs Adds unit tests for path builder APIs.
tests/NImpeller.Tests/Unit/LifetimeTests.cs Adds lifetime/idempotent dispose tests for wrappers.
tests/NImpeller.Tests/Unit/BuilderStateTests.cs Adds tests for builder save/restore and display list creation.
tests/NImpeller.Tests/TextureInteropTests.cs Adds a GL texture interop golden test.
tests/NImpeller.Tests/test.runsettings Forces software GL (llvmpipe) via environment variables for test runs.
tests/NImpeller.Tests/Scenes/IScene.cs Defines scene interface and render parameters for golden tests.
tests/NImpeller.Tests/Scenes/GoldenScenes.cs Implements deterministic scenes used for golden-image regression.
tests/NImpeller.Tests/RenderGate.cs Gates render tests based on availability and CI/local behavior.
tests/NImpeller.Tests/NImpeller.Tests.csproj Adds the new test project and dependencies (xUnit v3, Silk.NET, runsettings).
tests/NImpeller.Tests/Impeller.targets Copies the correct native Impeller library into test output.
tests/NImpeller.Tests/Headless/RawImage.cs Implements raw image storage/comparison and PNG output for diagnostics.
tests/NImpeller.Tests/Headless/ImpellerGLFixture.cs Provides a shared GL fixture for tests and scene rendering.
tests/NImpeller.Tests/Headless/HeadlessImpellerContext.cs Implements a thread-affine headless SDL+GLES context, offscreen rendering, and readback.
tests/NImpeller.Tests/Goldens/.gitkeep Documents committed golden baseline storage and update flow.
tests/NImpeller.Tests/GoldenImageTests.cs Implements the golden-image test runner and baseline update logic.
tests/NImpeller.Tests/AssemblyInfo.cs Disables test parallelization due to shared thread-affine GL context.
README.md Documents how to run the test suite locally.
NImpeller.sln Adds the test project to the solution.
.github/workflows/tests.yml Adds Ubuntu CI job to install deps, generate bindings, and run tests under Xvfb.

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

Comment thread tests/NImpeller.Tests/Headless/HeadlessImpellerContext.cs
Comment thread tests/NImpeller.Tests/Headless/HeadlessImpellerContext.cs
@drasticactions
drasticactions merged commit c18b2b4 into master Jul 1, 2026
2 checks passed
@drasticactions
drasticactions deleted the dev/timill/test-runner branch July 1, 2026 01:45
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