Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Conversation

@ivanpovazan
Copy link
Contributor

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

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#17774

/cc: @rolfbjarne

@rolfbjarne rolfbjarne changed the title Always use NUnitTestAssemblyRunner's Load overload with the assembly name Always use NUnitTestAssemblyRunner's Load overload with the assembly name Mar 16, 2023
@rolfbjarne rolfbjarne merged commit 2836386 into xamarin:main Mar 16, 2023
rolfbjarne pushed a commit that referenced this pull request Mar 23, 2023
…e assembly name (#117)

Due to legacy Xamarin test failures: dotnet/macios#17819 (comment)
The change should only affect tests and code paths which are using NUnit nuget package.

Related to: #116
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adapt monotouch-test to work with NativeAOT

2 participants