Skip to content

Investigate AOT-compatible test tooling #54

@jamescrosswell

Description

@jamescrosswell

Follow-up to #42 / #53.

The AOT switch only covers the release binary; tests still run under JIT. Worth investigating whether the whole stack can be AOT-clean — a real native binary plus a test suite that exercises the same compilation mode catches issues the publish step doesn't (e.g. reflection that only fires on a code path tests don't hit at JIT but would surface as a MissingMetadataException at runtime under AOT).

Things to check

  • xUnit v3 on Microsoft.Testing.Platform reportedly supports AOT now. Confirm against our current test project layout (tests/TuiCode.Tests, single assembly, xUnit v3 + MTP — see AGENTS.md#tests). If it works, flipping IsAotCompatible=true on the test project is the first thing to try.
  • If xUnit v3 isn't there yet, survey alternatives (TUnit is the obvious one — AOT-first by design).
  • Mocking: we don't use NSubstitute today (codebase is MockFileSystem + a couple of InMemory* services), so we may be lucky. Confirm no test reaches for a runtime proxy library. If we ever do, that's the harder constraint — NSubstitute / Moq use Castle.DynamicProxy which is not AOT-safe.
  • Input injection tests (host.App.InjectKey from TG's Iteration event) — verify TG's test path is AOT-clean.

Out of scope

  • Actually flipping the test project to AOT — this issue is just the survey. Once we know it's viable, the flip is a separate PR.

Why bother

A green JIT test suite + a green AOT publish is not the same as a tested AOT binary. We've already seen one trim warning that the publish step caught but JIT tests would have happily ignored; the asymmetry will get worse as features grow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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