Skip to content

Adapt monotouch-test to work with NativeAOT #17774

Closed
xamarin/Touch.Unit
#116
@ivanpovazan

Description

@ivanpovazan

Description

During the startup, monotouch-test app collects the assemblies which represent test suites and calls NUnitTestAssemblyRunner to bundle each of them in a TestSuite object.
This happens in TouchRunner::GetViewController through LoadSync method.

The following code path is followed:

https://github.com/spouliot/Touch.Unit/blob/564433f35c8ab6b7bb0709f83e1b81a89c406956/NUnitLite/TouchRunner/TouchRunner.cs#L168-L170

https://github.com/spouliot/Touch.Unit/blob/564433f35c8ab6b7bb0709f83e1b81a89c406956/NUnitLite/TouchRunner/TouchRunner.cs#L608C4

https://github.com/nunit/nunit/blob/af8ca8bc779072b4fa5432e8620f06ca796d13a3/src/NUnitFramework/framework/Api/NUnitTestAssemblyRunner.cs#L170

https://github.com/nunit/nunit/blob/af8ca8bc779072b4fa5432e8620f06ca796d13a3/src/NUnitFramework/framework/Api/DefaultTestAssemblyBuilder.cs#L81

https://github.com/nunit/nunit/blob/af8ca8bc779072b4fa5432e8620f06ca796d13a3/src/NUnitFramework/framework/Internal/AssemblyHelper.cs#L48-L56

Finally, the final piece ends up calling CodeBase property on Assembly type which is not supported with NativeAOT:
https://github.com/dotnet/runtime/blob/588dcd7a29f109daae2d8c999322acd8e853a8c6/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/ThunkedApis.cs#L70-L78

Proposal

/cc: @rolfbjarne

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsAnything related to tests

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions