This repository was archived by the owner on Jan 10, 2025. It is now read-only.
Commit 2836386
authored
Always use NUnitTestAssemblyRunner's Load overload with the assembly name (#116)
This PR adds a workaround to support NativeAOT runtime with Xamarin.
### Introduction
The limitation comes from the unsupported or limited support for the following properties on `Assembly` type with NativeAOT
- `CodeBase` - unsupported feature - throws with: https://github.com/dotnet/runtime/blob/588dcd7a29f109daae2d8c999322acd8e853a8c6/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/ThunkedApis.cs#L70-L78
- `Location` - somewhat supported - empty string: https://github.com/dotnet/runtime/blob/588dcd7a29f109daae2d8c999322acd8e853a8c6/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/ThunkedApis.cs#L66
Both properties do not seem to make sense with NativeAOT, as the assembly is not preserved in its original format.
These limitations prevent using NUnitTestAssemblyRunner's Load overload which accepts `Assembly` object as parameter, which is discussed in the tracking issue: dotnet/macios#17774
### Changes
The included change, changes the way the `TestSuite` is created by NUnit framework for all runtimes.
This affects the created name of test suites in the following way e.g.,:
- `monotouchtest.dll` -> `monotouchtest`
- `EmbeddedResources.dll` -> `EmbeddedResources`
- ...etc
The change has been tested locally with monotouch-test running on iOS device using .NET7 mono runtime
---
Fixes: dotnet/macios#177741 parent 564433f commit 2836386
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
0 commit comments