Граф коммитов

136 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 074a90496f
[tests] Don't try to create an instance of PKPaymentAuthorizationViewController. (#14334)
The default constructor doesn't work (it's already obsolete).

Fixes:

    Xamarin.Mac.Tests.DelegateAndDataSourceTest
        [FAIL] DelegateAndDataSourceAllowsNull : 1 failing types
            1 failing types:
            PassKit.PKPaymentAuthorizationViewController: Could not initialize an instance of the type 'PassKit.PKPaymentAuthorizationViewController': the native 'init' method returned nil.
            It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.
                at Xamarin.Mac.Tests.DelegateAndDataSourceTest.DelegateAndDataSourceAllowsNull () [0x0026c] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/ObjCRuntime/DelegateAndDataSourceTest.cs:90
2022-03-09 08:10:21 +01:00
Rolf Bjarne Kvinge 2140d46327
[monotouch-test] The RuntimeTest.ResurrectedObjectsDisposedTest test seems to be passing everywhere in .NET now. (#14175) 2022-02-18 16:34:58 +01:00
Rolf Bjarne Kvinge 97afd484d2
[ObjCRuntime] Keep accepting IntPtr constructors in .NET as an alternative to NativeHandle constructors. Fixes #14046. (#14145)
As a part of the breaking changes in .NET, we introduced a new type,
`ObjCRuntime.NativeHandle`, to represent native handles.

This meant that constructors taking taking `IntPtr handle`:

```cs
public class MyUIViewController : UIViewController {
    protected MyUIViewController (IntPtr handle)
        : base (handle)
    {
    }
}
```

would have to be ported to take `NativeHandle handle`:

```cs
public class MyUIViewController : UIViewController {
    protected MyUIViewController (NativeHandle handle)
        : base (handle)
    {
    }
}
```

The unfortunate part is that there will be no compiler warnings or errors
flagging this, so users won't know to do it unless they either read the
documentation (🤣) or run into the problem, googles for a while, runs into
someone else who had the same problem, and applies their (probably broken)
fix.

So we change our logic to:

1. Look for and use an `(IntPtr)` (or `(IntPtr, bool)`) constructor in .NET if
   the `NativeHandle` version isn't found.
2. Show a warning.
3. Some time in the future maybe remove this hack/workaround.

Fixes https://github.com/xamarin/xamarin-macios/issues/14046.
2022-02-15 22:48:23 +01:00
Stephane Delcroix f36606e654
[C] Clear OpenTK namespace (#13767)
fixes #13160

- remove unused types
- use System.Numerics when possible
- move own created types from OpenTK namespace to CoreGraphics
- create missing types in CoreGraphics namespace

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-02-14 18:50:23 +01:00
Rolf Bjarne Kvinge 5eda463eaf
[Foundation] Remove a WebKit workaround for NSProxy on tvOS in .NET. (#14089)
The WebKit framework doesn't exist on tvOS.
2022-02-08 10:48:40 +01:00
Rolf Bjarne Kvinge ef3b05478e
[tools/runtime] Enable exception marshalling by default for all platforms in .NET. (#14051)
When exception marshalling was originally implemented, for backwards
compatibility concerns it was only turned on by default for platforms that
really needed it (watchOS).

However, exception marshalling is by far the safest option, so in .NET we're
enabling it by default for all platforms (it's still possible to disable it
for those who wants to).

Ref: https://docs.microsoft.com/en-us/xamarin/ios/platform/exception-marshaling
2022-02-07 14:12:32 +01:00
Rolf Bjarne Kvinge d5697a8867
[runtime] Use the full managed description (including inner exceptions) as the reason when creating an NSException from a managed exception. (#14002)
This makes diagnosing what happens much easier in some cases.

Exhibit A, pre fix:

    *** Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException', reason: 'Failed to lookup the required marshalling information.
    Additional information:
    	Selector: conformsToProtocol:
    	Type: ViewController

Exhibit B, post fix:

    *** Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException', reason: 'Failed to lookup the required marshalling information.
    Additional information:
    	Selector: conformsToProtocol:
    	Type: ViewController
     (ObjCRuntime.RuntimeException)
    Failed to get the 'this' instance in a method call to templ.ViewController.InvokeConformsToProtocol. (ObjCRuntime.RuntimeException)
       at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject(Type type, IntPtr selector, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
       at ObjCRuntime.Runtime.GetMethodAndObjectForSelector(IntPtr klass, IntPtr sel, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
       at ObjCRuntime.Runtime.get_method_and_object_for_selector(IntPtr cls, IntPtr sel, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc, IntPtr& exception_gchandle)
    Failed to marshal the Objective-C object 0x7f813fd2f470 (type: ViewController). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'templ.ViewController' does not have a constructor that takes one NativeHandle argument). (ObjCRuntime.RuntimeException)
       at ObjCRuntime.Runtime.MissingCtor(IntPtr ptr, IntPtr klass, Type type, MissingCtorResolution resolution)
       at ObjCRuntime.Runtime.ConstructNSObject[T](IntPtr ptr, Type type, MissingCtorResolution missingCtorResolution)
       at ObjCRuntime.Runtime.ConstructNSObject(IntPtr ptr, IntPtr klass, MissingCtorResolution missingCtorResolution)
       at ObjCRuntime.Runtime.GetNSObject(IntPtr ptr, MissingCtorResolution missingCtorResolution, Boolean evenInFinalizerQueue)
       at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject(Type type, IntPtr selector, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc)
2022-02-02 16:22:34 +01:00
Rolf Bjarne Kvinge b1ce33ba51
[Foundation/ObjCRuntime] Use 'ObjCException' as the native exception type name for all platforms in .NET. Fixes #13855. (#13915)
* Use 'ObjCException' instead of 'MonoTouchException' as the managed exception
  type wrapping an NSException for all platforms in .NET (that was already the
  case for macOS, so no change there).
* Make the ObjCException class behave like the MonoTouchException class does.
* Move the ObjCException type to the ObjCRuntime namespace in .NET.

Fixes https://github.com/xamarin/xamarin-macios/issues/13855.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-02-01 17:24:57 +01:00
Rolf Bjarne Kvinge 43d74fb895
[ObjCRuntime] Add explicit conversion operators between NativeHandle and void*. Fixes #13867. (#13929)
Fixes https://github.com/xamarin/xamarin-macios/issues/13867.
2022-01-28 10:03:54 +01:00
Sebastien Pouliot 25fab0b74e
[net][coregraphics] Match native strings representation for structs (#13802)
* Use the native `NSStringFrom*` API so we can, eventually, use the
native code to parse them from `NSString` and also ensure increased
compatibility with any code that expects the native string representation

* Add unit tests for `ToString` methods

Also use [`System.HashCode`](https://docs.microsoft.com/en-us/dotnet/api/system.hashcode?view=net-6.0) to generate the hash code
2022-01-21 08:46:25 +01:00
Rolf Bjarne Kvinge a35ee4e7a6
[CoreAnimation] Rename CATransform3D's fields to follow standard naming conventions for .NET. (#13684)
Public fields shouldn't start with a lower-cased letter.

Also provide public properties in legacy Xamarin so that we can write
identical code for both, and obsolete the lower-cased fields.
2022-01-12 21:46:20 +01:00
Rolf Bjarne Kvinge 16358a7963
[ObjCRuntime] Fix the DisposableObject.Owns property to return the correct value. Fixes #13646. (#13666)
* [ObjCRuntime] Fix the DisposableObject.Owns property to return the correct value. Fixes #13646.

Ops...

Also add tests to avoid more oopses.

Fixes https://github.com/xamarin/xamarin-macios/issues/13646.

* Update tests/monotouch-test/AudioToolbox/AudioConverterTest.cs

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-01-11 15:37:31 +01:00
Rolf Bjarne Kvinge b169c806fc
[dotnet] Remove Runtime.Arch and ObjCRuntime.Arch from Mac Catalyst. Fixes #10312. (#13562)
Remove Runtime.Arch and ObjCRuntime.Arch from Mac Catalyst, because they don't
apply for a Mac Catalyst app (which is neither a simulator environment, nor a
device environment).

This means that code using these APIs will have to be re-evaluated to
determine what's the correct behavior for Mac Catalyst.

Also update our tests accordingly.

Fixes https://github.com/xamarin/xamarin-macios/issues/10312.
2021-12-15 22:32:14 +01:00
Rolf Bjarne Kvinge a93d76304e
[src] Modify some logic for Mac Catalyst that tests the current runtime architecture (Runtime.Arch) to behave like macOS instead (which doesn't check Runtime.Arch). (#13536) 2021-12-14 08:26:14 +01:00
Rolf Bjarne Kvinge c93cd3a99c
[Metal] Usher the Metal API into the golden age of .NET. (#13533)
* Change all XAMCORE_4_0 conditions to NET conditions.
* Add numerous Release attributes that xtro started complaining about.
* Misc other minor API changes/updates.
2021-12-13 20:40:29 +01:00
Rolf Bjarne Kvinge 15a7216aa8
[ObjCRuntime] Remove deprecated availability attribute API from .NET. (#13433)
* [ObjCRuntime] Remove deprecated availability attribute API from .NET.

They're quite useful for binding code though, so instead of removing them completely,
make them binding-only attributes (like numerous other binding attributes we have)
for .NET.

* [src] Remove removed attributes from the list of attributes that should be removed by the linker.

* [tests] Update tests to not use the old attributes for .NET.
2021-12-09 07:41:07 +01:00
Rolf Bjarne Kvinge 39ab97113c
[src] Adjust numerous APIs to take/return NativeHandle instead of IntPtr for .NET. (#13488)
* [Foundation] Make numerous CFArray and NSArray APIs take/return NativeHandle instead of IntPtr.

* [src] Fix a lot of other cases of IntPtr -> NativeHandle.

This is just fallout from the CFArray/NSArray in the previous commit.
2021-12-03 07:58:29 +01:00
Rolf Bjarne Kvinge 19c2765156 [tests][monotouch-test] Adjust code to cope with NativeHandle. 2021-11-26 14:25:21 +01:00
Rolf Bjarne Kvinge 2bb5fc88c5
[src] Adjust visibility of numerous (IntPtr) and (IntPtr, bool) constructors (#13444)
* There should be no public (IntPtr) constructor, at most there should be a
  protected one for NSObject subclasses. There should be no such constructors
  for classes that just implement INativeObject.
* There should be no public (IntPtr, bool) constructor at all, they should all
  be internal.
* If changing the visibility or removing the ctor is a breaking change, then
  make it happen for .NET only.
2021-11-26 14:24:05 +01:00
Rolf Bjarne Kvinge 6302878ad5
[runtime] Implement storing the original working directory for later retrieval for .NET. Fixes #13392. (#13403)
This also adds the Runtime.OriginalWorkingDirectory to all platforms.

Fixes https://github.com/xamarin/xamarin-macios/issues/13392.
2021-11-22 18:50:28 +01:00
Rolf Bjarne Kvinge 66e596e9d9
[tests] Change TestRuntime.CheckSystemVersion to take a ApplePlatform value instead of a PlatformName enum. (#13350)
The PlatformName enum will be removed from .NET soon.
2021-11-15 08:06:36 +01:00
Rolf Bjarne Kvinge 08c1dca26a
[AppKit/Foundation/UIKit] Use Foundation.NSWritingDirection instead of UIKit.UITextWritingDirection and AppKit.NSWritingDirection for .NET. Fixes #6573. (#13243)
Fixes when building with XAMCORE_4_0:

> uikit.cs(6775,3): error CS0246: The type or namespace name 'UITextWritingDirection' could not be found (are you missing a using directive or an assembly reference?)
> uikit.cs(6597,3): error CS0246: The type or namespace name 'UITextWritingDirection' could not be found (are you missing a using directive or an assembly reference?)
> uikit.cs(6601,41): error CS0246: The type or namespace name 'UITextWritingDirection' could not be found (are you missing a using directive or an assembly reference?)

Fixes https://github.com/xamarin/xamarin-macios/issues/6573.
2021-11-05 08:12:44 +01:00
Rolf Bjarne Kvinge 696e7a5679
[ObjCRuntime] Add a non-deprecated internal system-version checking API and use it everywhere. (#13231)
* [ObjCRuntime] Add a non-deprecated internal system-version checking API and use it everywhere.

The PlatformHelper class is deprecated, so implement a new version that isn't
deprecated, and which shares a similar API between all platforms - the Check*
methods includes the name of the platform, because that makes it clearer which
version we're talking about from the call site. There's a quirk though:
there's no separate ChecktvOS or CheckMacCatalyst, because the system version
is the same as for iOS, so we can just use 'iOS'.

For macOS we can now use NSProcessInfo.ProcessInfo.OperatingSystemVersion to
determine the OS version, because it's supported in all versions of macOS we
support for .NET.

Fixes issues such as this when building with XAMCORE_4_0:

> CoreMedia/CMSync.cs(590,11): error CS0103: The name 'PlatformHelper' does not exist in the current context

* Bring back PlatformHelper.CheckSystemVersion, but only for !NET.

* [tests] Remove 32-bit macOS logic, it's long dead.

* [introspection] Implement OS version check using 'NSProcessInfo.ProcessInfo.IsOperatingSystemAtLeastVersion' for macOS.

* [monotouch-test] Use TestRuntime.[Check|Assert]XcodeVersion instead of PlatformHelper.CheckSystemVersion.
2021-11-04 11:13:23 +01:00
Rolf Bjarne Kvinge af23d61926
[runtime] Fix a toggle ref deadlock when retaining objects. Fixes #13066. (#13071)
The deadlock goes like this:

1. Thread A holds the framework_peer_release_lock lock, and tries to lock the
   refcount_mutex lock.
2. Thread B holds the refcount_mutex, and is waiting for the GC to complete
3. Thread C is trying to lock the framework_peer_release_lock while running
   the GC.

The fix is in thread A, by not doing anything at all with the
framework_peer_release_lock lock locked.

The code contains extensive comments explaining the situation and the solution.

Fixes https://github.com/xamarin/xamarin-macios/issues/13066.

Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
2021-10-22 09:05:07 +02:00
Rolf Bjarne Kvinge 403bc2e774
[tests] Add a test to verify that AppDomain.CurrentDomain.BaseDirectory is always something. Fixes #12687. (#12885)
Fixes https://github.com/xamarin/xamarin-macios/issues/12687.
2021-10-01 08:29:56 +02:00
Rolf Bjarne Kvinge 1192cd6975
[tests] Fix creation of IntPtr to work on a 32-bit system. (#12713) 2021-09-15 09:29:10 +02:00
Sebastien Pouliot 1c937ac39b
[tests][monotouch-test] Re-enable registrar test for conformsToProtocol for dotnet (#12411)
This works fine now. I'm fairly sure this was fixed when the the last
custom steps of the linker were ported for dotnet illink

Fix https://github.com/xamarin/xamarin-macios/issues/11540
2021-08-11 20:16:01 -04:00
Rolf Bjarne Kvinge 2972e1b715
Fix some whitespace issues in various files. (#12399)
* Remove BOM
* Add EOL at end of file.
2021-08-11 10:06:46 +02:00
Rolf Bjarne Kvinge 12cf14662f
[monotouch-test] Resolve symlinks in paths before comparing them. (#12321)
Fixes this test failure on device:

    [FAIL] CurrentDirectory :   Current directory at launch
      Expected string length 97 but was 89. Strings differ at index 1.
      Expected: "/private/var/containers/Bundle/Application/4824129A-8668-4CD9..."
      But was:  "/var/containers/Bundle/Application/4824129A-8668-4CD9-9280-7F..."
2021-08-03 07:36:26 +02:00
Rolf Bjarne Kvinge a3f9519ed1 Merge remote-tracking branch 'origin/main' into HEAD 2021-07-20 14:53:57 +02:00
Rolf Bjarne Kvinge 3c38f8ccd6
[dotnet] Enable autorelease pools for threadpools. Fixes #11750. (#12060)
Fixes https://github.com/xamarin/xamarin-macios/issues/11750.
2021-07-20 14:34:37 +02:00
Rolf Bjarne Kvinge e968a93282
[monotouch-test] Create a shared.csproj for all the .NET monotouch-test project files. (#12128)
* [monotouch-test] Create a shared.csproj for all the .NET monotouch-test project files.

Also complete the logic to build metal files, so that it works on Mac Catalyst as well.

* [monotouch-test] Add helper makefiles.

* [monotouch-test] Fix the RootTestsDirectory in the csproj.

* [monotouch-test] Add empty ItemGroup for xharness to put stuff in.

* [monotouch-test] Set DYNAMIC_REGISTRAR in each csproj, because xharness needs to be able to unset it.

* [monotouch-test] Exclude tests that don't work with AOT from Mac Catalyst/ARM64.

* [monotouch-test] Use 'ComputedPlatform' instead of 'Platform' to determine whether we're building for a device or not.

'Platform' can be anything, while we know the value of 'ComputedPlatform'. And
since 'ComputedPlatform' is computed after the csproj is read, we need to
delay the computation until later (thus in a separate target).
2021-07-19 16:43:22 +02:00
Rolf Bjarne Kvinge fc8fb4818c
[runtime] Set the current directory to the root directory of the app bundle for all platforms in .NET. (#12104)
To have consistent behavior in .NET, set the current directory to the root of
the app bundle for all platforms.

This is a breaking change for legacy Xamarin.Mac, which used to set the
current directory to the Contents/Resources subdirectory, but there's a simple
workaround for customers that depend on the old behavior (change it in Main
themselves), and I believe the consistent experience across platforms warrants
this change.

Note that we already had a breaking change here for macOS/.NET: we were
(unintentionally) setting the current directory to the Contents/MonoBundle
directory, which neither matched mobile platforms, nor the legacy Xamarin.Mac
behavior.

This solves the problem of what to do for Mac Catalyst apps, because there's
no need to choose between the macOS or the mobile behavior, since they're the
same.

This required changing the launch of macOS apps using CoreCLR to pass the full
path to the entry assembly, since the entry assembly isn't in the current
directory anymore.
2021-07-14 17:42:49 +02:00
Rolf Bjarne Kvinge cfcedfbe53 [monotouch-test] Use CultureInfo.InvariantCulture instead of 'en-US' to parse invariant numbers.
Fixes this test failure:

	[FAIL] FloatingPointStretTrampolineTest : System.Globalization.CultureNotFoundException : Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
        en-US is an invalid culture identifier.
           at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) in System.Private.CoreLib.dll:token 0x60027b4+0x2f
           at System.Globalization.CultureInfo..ctor(String name) in System.Private.CoreLib.dll:token 0x60027b3+0x0
           at MonoTouchFixtures.ObjCRuntime.FloatingPointStretTrampolines.ParseString(String str) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs:line 640
           at MonoTouchFixtures.ObjCRuntime.FloatingPointStretTrampolines.Test_CGRect_IntPtr(NSString str) in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs:line 664
        --- End of stack trace from previous location ---
           at MonoTouchFixtures.ObjCRuntime.TrampolineTest.FloatingPointStretTrampolineTest() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/ObjCRuntime/TrampolineTest.cs:line 242
           at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in System.Private.CoreLib.dll:token 0x6004f05+0x6a
2021-07-12 23:59:50 +02:00
Rolf Bjarne Kvinge 071ac6463e
[coreclr] Support for NSAutoreleasePools has now been implemented for background threads for both MonoVM and CoreCLR. Fixes #11256. (#11749)
Fixes https://github.com/xamarin/xamarin-macios/issues/11256.
2021-06-02 07:41:44 +02:00
Rolf Bjarne Kvinge f3b46b955f
[runtime] Add support for toggle refs to CoreCLR. (#11757)
The code contains comments explaining the new behavior.

Some tests that poked into the private 'flags' field on NSObject had to be
updated, because the field is now named differently in .NET.

I also added two more tests for toggle ref scenarios.
2021-06-02 00:13:49 +02:00
Rolf Bjarne Kvinge 0864407f78
[tests] Adjust MX8029_b and MX8033 tests to cope with slightly different exception message output for CoreCLR. (#11732)
* [tests] Adjust MX8029_b and MX8033 tests to cope with slightly different exception message output for CoreCLR.

Fixes these unit tests:

    [FAIL] MX8029_b :   Message
      Expected string length 217 but was 238. Strings differ at index 149.
      Expected: "...lector: setIntArray:\n\tMethod: MonoTouchFixtures.ObjCRuntim..."
      But was:  "...lector: setIntArray:\n\tMethod: System.Void MonoTouchFixture..."
      ----------------------------------------------^
      at MonoTouchFixtures.ObjCRuntime.RuntimeTest.MX8029_b() in /Users/rolf/work/maccore/onedotnet/xamarin-macios/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs:line 625

    [FAIL] MX8033 :   Message
      Expected string length 192 but was 207. Strings differ at index 129.
      Expected: "...\n\tSelector: intArray\n\tMethod: MonoTouchFixtures.ObjCRuntim..."
      But was:  "...\n\tSelector: intArray\n\tMethod: System.Int32[] MonoTouchFixt..."
      ------------------------------------------------^
      at MonoTouchFixtures.ObjCRuntime.RuntimeTest.MX8033() in /Users/rolf/work/maccore/onedotnet/xamarin-macios/tests/monotouch-test/ObjCRuntime/RuntimeTest.cs:line 644

* There's no need to restrict the TestRuntime.IsCoreCLR method to .NET code only.

The logic works just as well on legacy Xamarin as well.

* Make code C# 7.3 compatible.

Fixes this error:

> xamarin-macios/tests/common/TestRuntime.cs(1183,46): error CS8370: Feature 'not pattern' is not available in C# 7.3. Please use language version 9.0 or greater.
2021-06-01 15:56:54 +02:00
Rolf Bjarne Kvinge b4a7a9ffe8
[tests] Re-enable Mac Catalyst tests related to the GC not working. (#11752)
This seems to be working again now.
2021-06-01 07:21:18 +02:00
Rolf Bjarne Kvinge fdae69f5d6
[tests] Only run the RegistrarTest.CustomUserTypeWithDynamicallyLoadedAssembly test from a source checkout. (#11743)
It needs another assembly built from the source tree, so it won't work unless
executed from a source checkout. This way we don't try to run it on older
macOS versions, where the required assembly won't exist.
2021-05-31 15:43:25 +02:00
Rolf Bjarne Kvinge 2bee92225c
[runtime] Complete support for exception marshalling on CoreCLR. (#11734)
* [runtime] Add support for exception marshalling to CoreCLR.

* [runtime] Add an empty implementation of the toggle ref machinery.

We need this to use the unhandled exception handler support in CoreCLR,
because the ObjectiveCMarshal.Initialize call to initialize unhandled
exception support requires passing toggle ref callbacks as well.

* [tests] The TestConstrainedGenericType test can now be re-enabled, after a few updates.
2021-05-31 08:10:34 +02:00
Rolf Bjarne Kvinge 165941ec14
[Runtime] Complete the CoreCLR implementation of setting the pending managed exeption. (#11709)
This made it possible to unignore some tests.

Co-authored-by: Alex Soto <alex@alexsoto.me>
2021-05-28 13:20:49 +02:00
Rolf Bjarne Kvinge ba4fa19267
[runtime] Intercept the objc_msgSend family of functions using CoreCLR's supported mechanisms. (#11692)
This allows us to re-introduce a few tests.
2021-05-27 07:29:39 +02:00
Rolf Bjarne Kvinge 1762888e1d
[tests] Build the custom-type-assembly separately for .NET (#11629)
It's a bit weird to build it twice, but it's the most straight forward way of
making the test work if either the .NET build or the legacy build is disabled.
2021-05-20 16:12:21 +02:00
Rolf Bjarne Kvinge ee5e2f0b09
[monotouch-test] Ignore tests that require exception marshalling on CoreCLR for now, they fail. (#11615)
This makes monotouch-test green when using CoreCLR, both when using the
dynamic and the static registrar.

Ref: https://github.com/xamarin/xamarin-macios/issues/10940
2021-05-20 07:34:30 +02:00
Rolf Bjarne Kvinge 34772d23bc
[Runtime] Don't skip dynamic user type checking as long as dynamic registration is supported. (#11588)
When checking whether a type is a user type or not, we might have to do a
dynamic check if the dynamic registrar is available. Otherwise we may run into
a situation where the static registrar ran during the app build, but then the
app loaded additional assemblies at runtime, and those assemblies contained
user types that were registered using the dynamic registrar, so the static
registrar doesn't know about those custom types (in other words: we need to
check at runtime).
2021-05-18 16:28:09 +02:00
Sebastien Pouliot b46cea29c7
[dotnet][tests] Fix monotouch-test RegistrarRemoval (#11527)
The registrar removal was fixed recently but the test was still failing.
Turns out xharness modify the linker setting for this test (as the
linker is required for this optimization) but the newer dotnet csproj
did not have an entry (to modify).

Fixes https://github.com/xamarin/xamarin-macios/issues/10512

[xharness] Fix monotouch-test build when LinkSdk is used for dotnet projects

Skip failing assertion, issue filled
2021-05-13 17:01:20 -04:00
Manuel de la Pena 01d11263b9
[Tests] Ignore tests that fail on VMs (#11524)
There are a number of tests that do not work on VMs yet our older
machines are using virtualization. Ignore those tests since we cannot
assert if they work or not.

fixes: https://github.com/xamarin/maccore/issues/2438
2021-05-13 08:41:07 -04:00
Rolf Bjarne Kvinge 12ba642b19 [monotouch-test] Adjust TestTypeEncodings for ARM64 on macOS. 2021-05-11 15:54:39 +02:00
Rolf Bjarne Kvinge 6457c5a5a4 [tests] Update tests to cope with macOS and simulator running on ARM64. 2021-05-11 15:54:39 +02:00
Rolf Bjarne Kvinge 9153edebda
[runtime] Redirect to our objc_msgSend wrapper functions when needed for .NET code. (#10932)
This makes the mono_dllmap_insert function unnecessary for .NET, so remove it.

Ref: https://github.com/dotnet/runtime/issues/48110
Ref: https://github.com/dotnet/runtime/issues/43204
Ref: #10504
2021-03-24 09:17:35 +01:00