* [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.
We added the github pages to make the life of the reviews easier, the
issue we found is that we have a limited amount of space. Due to that we
are removing the generation from the ci.
Triggers in pipleines are disable by default, removing it will stop it
from being executed. The PR are triggered via a release pipeline we
called macios.glue
Before:
There were 258096 MonoObjects created, 246948 MonoObjects freed, so 11148 were not freed. (dynamic registrar)
There were 205834 MonoObjects created, 205214 MonoObjects freed, so 620 were not freed. (static registrar)
After:
There were 205834 MonoObjects created, 205222 MonoObjects freed, so 612 were not freed. (dynamic registrar)
There were 258100 MonoObjects created, 258019 MonoObjects freed, so 81 were not freed. (static registrar)
* If the return value from xamarin_get_reflection_method_method is cached in a
static variable, we can only release at process exist.
* Otherwise just release at the end of the current method.
Before:
There were 258096 MonoObjects created, 246948 MonoObjects freed, so 11148 were not freed. (dynamic registrar)
There were 205834 MonoObjects created, 205214 MonoObjects freed, so 620 were not freed. (static registrar)
After:
There were 258092 MonoObjects created, 246945 MonoObjects freed, so 11147 were not freed. (dynamic registrar)
There were 205834 MonoObjects created, 205600 MonoObjects freed, so 234 were not freed. (static registrar)
While not strictly necessary to not leak (because the process is exiting
anyway), it makes it easier to read leak reports, because these dictionaries
won't show up as leaked memory anymore.
Before:
There were 258096 MonoObjects created, 258015 MonoObjects freed, so 81 were not freed. (dynamic registrar)
There were 205834 MonoObjects created, 205833 MonoObjects freed, so 1 were not freed. (static registrar)
After:
There were 258104 MonoObjects created, 258025 MonoObjects freed, so 79 were not freed. (dynamic registrar)
There were 205834 MonoObjects created, 205834 MonoObjects freed, so no leaked MonoObjects. (static registrar)
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.
* [AVFoundation] Set watchOS availability for a few classes that were forgotten about in Xcode 12.5.
Partially fixes https://github.com/xamarin/maccore/issues/2420.
* [introspection] Cope with MLSequence's lack of protocol compliance in earlier versions of watchOS.
Partially fixes https://github.com/xamarin/maccore/issues/2420.
* [introspection] Improve error message to include method and type data.
Fixes these failures when on a VM:
Xamarin.Mac.Tests.AudioUnitTests
[FAIL] GetCurrentDevice_Test : Expected: True
But was: False
at Xamarin.Mac.Tests.AudioUnitTests.GetCurrentDevice_Test () [0x00011] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/AudioUnit/AudioUnit.cs:37
Xamarin.Mac.Tests.AudioUnitTests : 13 ms
Xamarin.Mac.Tests.AUGraphTests
[FAIL] DoTest : Did not see events after 1 second
at Xamarin.Mac.Tests.AUGraphTests.WaitOnGraphAndMixerCallbacks () [0x00050] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/AudioUnit/AUGraphTestMac.cs:93
at Xamarin.Mac.Tests.AUGraphTests.DoTest () [0x0004c] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/AudioUnit/AUGraphTestMac.cs:66
Xamarin.Mac.Tests.AUGraphTests : 3113 ms
Xamarin.Mac.Tests.AVAudioIONodeTests
[FAIL] AVAudioIONodeTests_AudioUnitTest : Foundation.ObjCException : com.apple.coreaudio.avfaudio: error -10879
at (wrapper managed-to-native) ObjCRuntime.Messaging.IntPtr_objc_msgSend(intptr,intptr)
at AVFoundation.AVAudioEngine.get_OutputNode () [0x00030] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/mac/mobile/AVFoundation/AVAudioEngine.g.cs:1099
at Xamarin.Mac.Tests.AVAudioIONodeTests.AVAudioIONodeTests_AudioUnitTest () [0x0000d] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/monotouch-test/AVFoundation/AVAudioIONode.cs:23
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/src/Xamarin.Mac/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395
Xamarin.Mac.Tests.AVAudioIONodeTests : 7 ms
Fixes this unit test:
[FAIL] ManagedExceptionPassthrough : exception
Expected: same as <System.ApplicationException: 3,14
at MonoTouchFixtures.ObjCRuntime.ExceptionsTest.ManagedExceptionTest.ThrowManagedException() in xamarin-macios/tests/monotouch-test/ObjCRuntime/ExceptionsTest.cs:line 128>
But was: <System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ApplicationException: 3,14
at MonoTouchFixtures.ObjCRuntime.ExceptionsTest.ManagedExceptionTest.ThrowManagedException() in xamarin-macios/tests/monotouch-test/ObjCRuntime/ExceptionsTest.cs:line 128
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in System.Private.CoreLib.dll:token 0x6004d2a+0x0
at ObjCRuntime.Runtime.InvokeMethod(MethodBase method, Object instance, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d1+0x254
at ObjCRuntime.Runtime.InvokeMethod(MonoObject* methodobj, MonoObject* instanceobj, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d0+0x0
at ObjCRuntime.Runtime.bridge_runtime_invoke_method(MonoObject* method, MonoObject* instance, IntPtr parameters, IntPtr& exception_gchandle) in Xamarin.Mac.dll:token 0x6001124+0x26
at ApiDefinition.Messaging.void_objc_msgSendSuper(IntPtr receiver, IntPtr selector)
at Bindings.Test.ObjCExceptionTest.InvokeManagedExceptionThrower() in xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test2683/obj/Debug/net6.0-macos/macOS/Bindings.Test/ObjCExceptionTest.g.cs:line 105
at MonoTouchFixtures.ObjCRuntime.ExceptionsTest.ManagedExceptionPassthrough() in xamarin-macios/tests/monotouch-test/ObjCRuntime/ExceptionsTest.cs:line 154>
at MonoTouchFixtures.ObjCRuntime.ExceptionsTest.ManagedExceptionPassthrough() in xamarin-macios/tests/monotouch-test/ObjCRuntime/ExceptionsTest.cs:line 159
* [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.
Before:
There were 258042 MonoObjects created, 235166 MonoObjects freed, so 22876 were not freed. (dynamic registrar)
There were 205804 MonoObjects created, 204219 MonoObjects freed, so 1585 were not freed. (static registrar)
After:
There were 258066 MonoObjects created, 246781 MonoObjects freed, so 11285 were not freed. (dynamic registrar)
There were 205804 MonoObjects created, 204491 MonoObjects freed, so 1313 were not freed. (static registrar)
Before:
There were 258042 MonoObjects created, 235166 MonoObjects freed, so 22876 were not freed. (dynamic registrar)
There were 205804 MonoObjects created, 204219 MonoObjects freed, so 1585 were not freed. (static registrar)
After:
There were 258050 MonoObjects created, 235177 MonoObjects freed, so 22873 were not freed. (dynamic registrar)
There were 205804 MonoObjects created, 204219 MonoObjects freed, so 1585 were not freed. (static registrar)
Before:
There were 258042 MonoObjects created, 235166 MonoObjects freed, so 22876 were not freed. (dynamic registrar)
There were 205804 MonoObjects created, 204219 MonoObjects freed, so 1585 were not freed. (static registrar)
After:
There were 258058 MonoObjects created, 235308 MonoObjects freed, so 22750 were not freed. (dynamic registrar)
There were 205804 MonoObjects created, 204219 MonoObjects freed, so 1585 were not freed. (static registrar)
Before:
There were 258046 MonoObjects created, 235142 MonoObjects freed, so 22904 were not freed. (dynamic registrar)
There were 205804 MonoObjects created, 204193 MonoObjects freed, so 1611 were not freed. (static registrar)
After:
There were 258054 MonoObjects created, 235172 MonoObjects freed, so 22882 were not freed. (dynamic registrar)
There were 205804 MonoObjects created, 205190 MonoObjects freed, so 614 were not freed. (static registrar)
This fixes a memory corruption where we'd try to process out parameters when
an exception had occurred, and those out parameters weren't expected to be
processed.
* [Actions] Clean data after a PR is closed.
To keep the github webpage small we remove the data once the PR has
been closed (that means closed or merged). The data will be kept in
vsdrops, the only links that will stop working are those from the github
static webpage.
Since we are interested in making the reviewer life better this is a
good compromise.
How to avoif merge conflicts:
We want to make sure we avoid merge conflicts, this is done using two
locks:
1. macios.ci-cleanup - Lock in the xamarin-macios action that will
ensure that we create a new branch to cleanup the data.
2. ci-results - Lock in the macios.ci action that will merge branhces
one by one.
This repo will create a new pr that cleans the data, the macios.ci repo
will execute an action when this new branch is created and will merge it
as soon as possible making sure that previos created branches are
merged.
* Update .github/workflows/github-page-clean-up.yml
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
Before:
There were 258046 MonoObjects created, 235142 MonoObjects freed, so 22904 were not freed. (dynamic registrar)
There were 205804 MonoObjects created, 204193 MonoObjects freed, so 1611 were not freed. (static registrar)
After:
There were 258054 MonoObjects created, 235172 MonoObjects freed, so 22882 were not freed. (dynamic registrar)
There were 205804 MonoObjects created, 204193 MonoObjects freed, so 1611 were not freed. (static registrar)
It's not trivial to do now, because the existing constructors are public,
which the generator isn't able to re-create without modifications (to the
generator).
So just add a reminder instead.
Due to the following reasons:
* Desktop apps like macOS and Mac catalyst can be launched directly from the
command line by users.
* It's trivial to set environment variables for desktop apps before launching
them.
* All the different command line arguments we support for mobile targets can
also be set using environment variables.
We don't need additional command line argument parsing for desktop platforms,
so just remove it.
The end result is that instead of doing this to run a specific unit test:
path/to/macOS/app/MacOS/Contents/theapp --app-arg --test --app-arg MyTestFixture
This will now work:
path/to/macOS/app/MacOS/Contents/theapp --test MyTestFixture
Which is how apps on desktop platforms should work anyway.
Before:
There were 258046 MonoObjects created, 235142 MonoObjects freed, so 22904 were not freed. (dynamic registrar)
There were 205804 MonoObjects created, 204193 MonoObjects freed, so 1611 were not freed. (static registrar)
After:
There were 258018 MonoObjects created, 235128 MonoObjects freed, so 22890 were not freed. (dynamic registrar)
There were 205809 MonoObjects created, 204221 MonoObjects freed, so 1588 were not freed. (static registrar)
This involves storing the out parameter in an additional variable, so that we
can still access it after the method call.
Before:
There were 257927 MonoObjects created, 235060 MonoObjects freed, so 22867 were not freed. (dynamic registrar)
There were 205700 MonoObjects created, 203983 MonoObjects freed, so 1717 were not freed. (static registrar)
After:
There were 257935 MonoObjects created, 235064 MonoObjects freed, so 22871 were not freed. (dynamic registrar)
There were 205700 MonoObjects created, 204006 MonoObjects freed, so 1694 were not freed. (static registrar)
Before:
> There were 205700 MonoObjects created, 113865 MonoObjects freed, so 91835 were not freed. (static registrar)
After:
> There were 205700 MonoObjects created, 113982 MonoObjects freed, so 91718 were not freed. (static registrar)