From e5ee9606f0c3463e117671d85247c063be76aa78 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 5 Sep 2018 12:47:52 +0200 Subject: [PATCH] [tests] Ignore RuntimeTest.MainThreadDeallocationTest if all optimizations are enabled and not linking everything. Fixes #4566. (#4744) This test contains code that requires the dynamic registrar unless the code is optimized, and it's only optimized if the assembly is linked, which only happens if linking all assemblies. So disable the test if dynamic registrar is removed (which happens when all optimizations are enabled) and the assembly isn't linked. Fixes https://github.com/xamarin/xamarin-macios/issues/4566. --- tests/bindings-test/RuntimeTest.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/bindings-test/RuntimeTest.cs b/tests/bindings-test/RuntimeTest.cs index 2547926ed6..2e3bc8cfad 100644 --- a/tests/bindings-test/RuntimeTest.cs +++ b/tests/bindings-test/RuntimeTest.cs @@ -59,6 +59,11 @@ namespace Xamarin.Tests [Test] public void MainThreadDeallocationTest () { +#if OPTIMIZEALL + if (!TestRuntime.IsLinkAll) + Assert.Ignore ("This test must be processed by the linker if all optimizations are turned on."); +#endif + ObjCBlockTester.CallAssertMainThreadBlockRelease ((callback) => { callback (42); });