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(-)
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(-)
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
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).
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.
Spot check!
Also, the tests run in 0.021s, which is 5x faster than using the JIT. ๐
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 ๐ฎโ๐จ).
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