Code review complete. Time to merge.

Final damage:

[native-aot cdfb42b2] Add Native AOT support
Date: Wed Feb 25 11:16:49 2026 -0800
856 files changed, 33149 insertions(+), 14167 deletions(-)

#DotNet #UnitTest #NativeAOT

New option coming for the xunit3 template: "--native-aot".

This will only be available for C# projects, since Native AOT is only implemented for C#. #DotNet #UnitTest #NativeAOT

They may take longer to builder, but they're definitely faster to run. ๐Ÿ˜„ #DotNet #UnitTest #NativeAOT
I'm positive the code generation has holes in it, despite my extensive attempt to ensure I covered all my bases, but... I think I'm ready the merge `native-aot` into `rel/4.0.0` and maybe push a pre-release build soon. #DotNet #UnitTest #NativeAOT

The existing xUnit.net analyzers that are errors are helping define the most important set of "did I remember to test for this?" in the code generators, because they almost all end up creating generated code that won't compile (e.g., m Member data pointing at a non-public member). Almost all of the rest inform what conditions need to be validated in the generated code (e.g. incorrect number of values in a data row vs. number of parameters to the test method).

#DotNet #UnitTest #NativeAOT

Still don't have caching wired up, and I don't think I'm gonna bother, because things definitely got faster.

Also, count-wise I clearly have to make a pass to determine if there are more current "reflection only" tests that need AOT backfills.

Also need to fix an issue where I'm calling tests multiple times if they're defined in a partial across separate files.

#DotNet #UnitTest #NativeAOT

Spot check!

Also, the tests run in 0.021s, which is 5x faster than using the JIT. ๐ŸŽ‰

#DotNet #UnitTest #NativeAOT

Tests fixed, and xunit.v3.core.tests restructured for the changes introduced to the runner hierarchy (CoreXyzRunner and associated context inserted between TestXyzRunner and XunitTestXyzRunner, with CodeGenXyzRunner also deriving from CoreXyzRunner).

Now it's time to get the xunit.v3.core.aot.tests building and passing, and add new tests for all the new code (which is significant ๐Ÿ˜ฎโ€๐Ÿ’จ).

#DotNet #UnitTest #NativeAOT

This morning, I'm adding the missing type coercion support for theory parameters.

I found another one that isn't going to work: `params` parameters for theories. There's no way for us to make the right kind of array at runtime, so we'll have to let you do the "hard work" of putting things in an array for us. Thankfully C#'s `[]` array syntax helper should make this conversion pretty trivial for most people. #DotNet #NativeAOT #UnitTest

On the plus side, I now have all of Fact, CulturedFact, Theory, and CulturedTheory running. Theories support InlineData, MemberData, and ClassData. User extensibility for data attributes will require people to write a code generator (kind of a bummer, but that's how all this Native AOT works). #DotNet #NativeAOT #UnitTest