Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to mono/2018-04 #3856

Merged
merged 110 commits into from
Jun 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
6f9b2f9
Bump mono to 2017-12
alexanderkyte Dec 29, 2017
b57b9f5
[integration] bump maccore
alexanderkyte Dec 29, 2017
7cadda4
Test fix for issue with stateful script loading
alexanderkyte Jan 4, 2018
4f787ac
Install only selected files to mimic Mono NO_INSTALL flag
marek-safar Jan 10, 2018
52154df
Exclude lines with comments from profile source files
marek-safar Jan 10, 2018
6570d15
Bump 2017-12 mono
marek-safar Jan 15, 2018
276a41f
Bump mono
marek-safar Jan 29, 2018
bf5da43
Bump Mono
marek-safar Jan 31, 2018
67a711e
Update linker sources location
marek-safar Jan 31, 2018
b2bd45e
More linker updates
marek-safar Jan 31, 2018
6afe61e
More build fixes
marek-safar Jan 31, 2018
2c5b177
Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-…
luhenry Feb 5, 2018
21711fd
Bump to mono:2018-02
luhenry Feb 5, 2018
3189621
[tests] reflect category rename of NotWorkingInterpreter to NotWorkin…
lewurm Feb 6, 2018
4d4f664
[tests] update regular expression for extracting mono version
lewurm Feb 6, 2018
52ef8c7
Merge remote-tracking branch 'origin/master' into mono-2018-02
lewurm Feb 6, 2018
c7a95b4
Bump to mono:2018-02
lewurm Feb 8, 2018
f7a2323
Fix debug spew
luhenry Feb 7, 2018
59571a1
Bump to mono:2018-02
lewurm Feb 8, 2018
90deb31
Bump to mono:2018-02
lewurm Feb 9, 2018
ffe3fed
Bump to mono:2018-02
lewurm Feb 12, 2018
b0ab16d
Merge remote-tracking branch 'origin/master' into mono-2018-02
lewurm Feb 20, 2018
7d5f720
Bump to mono:2018-02
lewurm Feb 20, 2018
81e0ae3
Bump mono min version to avoid nuget restore issue
lewurm Feb 21, 2018
c9fbaf5
Bump to mono:2018-02
lewurm Feb 21, 2018
30421a5
Bump Touch.Unit
lewurm Feb 22, 2018
5936e07
Bump to mono:2018-02
lewurm Feb 22, 2018
23a7ddd
bump system mono to include xbuild workaround for fsharp
lewurm Feb 23, 2018
098c986
Merge remote-tracking branch 'origin/master' into mono-2018-02
lewurm Feb 23, 2018
4b292ef
Bump to mono:2018-02
lewurm Feb 27, 2018
ecc9293
unbump touch.unit
lewurm Feb 27, 2018
129a4cb
Merge remote-tracking branch 'origin/master' into mono-2018-02
lewurm Feb 27, 2018
a8ae06d
bump touch.unit
lewurm Mar 2, 2018
1f34209
Bump to mono:2018-02
lewurm Mar 2, 2018
af2af96
Merge remote-tracking branch 'origin/master' into mono-2018-02
lewurm Mar 2, 2018
bf9448e
Bump to mono:2018-02
lewurm Mar 5, 2018
7920e03
Merge remote-tracking branch 'origin/master' into mono-2018-02
lewurm Mar 5, 2018
77c30b6
Update linker tests using reflection not to be caught by linker refle…
marek-safar Mar 7, 2018
4ba043c
More linker reflection checks updates
marek-safar Mar 7, 2018
a7abab1
Fixes Bug59015 test to check for method is was intented to
marek-safar Mar 8, 2018
4748f82
[mmptest] fix linker test in link-safe-1
lewurm Mar 8, 2018
97c0581
Merge remote-tracking branch 'origin/master' into mono-2018-02
lewurm Mar 11, 2018
3a242e1
Bump to mono:2018-02
lewurm Mar 11, 2018
3e825fe
Bump to mono:2018-02
lewurm Mar 12, 2018
8133cbe
[linker] update facades list for .NET 4.7.1
lewurm Mar 12, 2018
9cb27be
Force libMonoPosixHelper usage in test to work around mono linker imp…
chamons Mar 14, 2018
34515ce
[msbuild] fix creation ouf output dependency (#3747)
lewurm Mar 14, 2018
4c16c4d
Bump to mono:2018-02
lewurm Mar 15, 2018
1e1fdf1
Merge remote-tracking branch 'origin/master' into mono-2018-02
lewurm Mar 15, 2018
bf0ce02
Merge remote-tracking branch 'origin/master' into mono-2018-02
lewurm Mar 20, 2018
bf95267
Bump to mono:2018-02
lewurm Mar 20, 2018
a07a5d4
Bump system mono
lewurm Mar 20, 2018
5f73544
Bump to mono:2018-02
lewurm Mar 21, 2018
0b26e37
Bump to mono:2018-02
lewurm Mar 26, 2018
d5b73cc
Merge remote-tracking branch 'origin/master' into mono-2018-02
lewurm Mar 26, 2018
d458533
Bump to mono:2018-02
lewurm Mar 27, 2018
4aa8444
Bump to mono:2018-02
lewurm Mar 30, 2018
fdc324b
Merge remote-tracking branch 'origin/master' into mono-2018-02
lewurm Mar 30, 2018
12fd9e6
Merge branch 'mono-2019-02' of github.com:xamarin/xamarin-macios into…
luhenry Apr 2, 2018
818ffad
Bump to mono/2018-04/59e6eb29
luhenry Apr 3, 2018
f64362b
Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-…
luhenry Apr 11, 2018
b5ab20d
Bump to mono/2018-04/28597809
luhenry Apr 11, 2018
51d56ed
Fix linker build
alexischr Apr 11, 2018
1eb69de
[mono] Update mono-api-info/html building instructions
alexischr Apr 12, 2018
79f896b
Bump mono
alexischr Apr 19, 2018
fbb3528
Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-…
alexischr Apr 19, 2018
4c36c44
Merge branch 'master' into mono-2018-04
spouliot Apr 23, 2018
7fe6617
[Make.config] Update MIN_OSX_BUILD_VERSION
alexischr Apr 24, 2018
59fe979
[mono] Update mono-api-info.exe location
alexischr Apr 24, 2018
cff3fa5
Bump to mono/2018-04/61fa43b9
luhenry Apr 25, 2018
bbee05a
Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-…
alexischr Apr 26, 2018
1e53f6b
Merge remote-tracking branch 'origin' into mono-2018-04
alexischr Apr 26, 2018
01efab5
Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-…
alexischr May 1, 2018
5eeb97e
Bump to mono/2018-04/fd09fd9d
alexischr May 1, 2018
b5f79ca
Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-…
alexischr May 4, 2018
fbb7cc1
[mmp]: Reflect latest 'FtpRequestCreator' -> 'FtpWebRequestCreator' c…
May 8, 2018
8379aa4
Merge pull request #4052 from baulig/work-martin-ftp
alexischr May 10, 2018
3697152
Track mono/2018-04
alexischr May 10, 2018
8d63024
[tests] Update AttributeTest.DebuggerTypeProxy_24203
alexischr May 10, 2018
a9c7778
Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-…
alexischr May 15, 2018
1e1a347
Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-…
alexischr May 15, 2018
5bc5b24
Bump to mono/2018-04/419d3136
alexischr May 22, 2018
569a1eb
Merge remote-tracking branch 'origin/master' into mono-2018-04
rolfbjarne May 23, 2018
ed80f34
[tests/mini] Enable use of C# 7.2, needed by mono test mono\mini\aot-…
alexischr May 23, 2018
0aba49c
[mmp] Update dllmaps to include System.Native redirected (for System.…
alexischr May 24, 2018
b2d022c
Bump Mono
marek-safar May 29, 2018
b3bed1a
Build mmp against old api to run on non-matching mono runtime versions
marek-safar May 29, 2018
37197e4
Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-…
alexischr May 29, 2018
5b1482e
[mmp] Adjust linker sources
alexischr May 29, 2018
3ff92c5
Revert garbage change by last commit
alexischr May 29, 2018
8e7cc5f
Bump mono
marek-safar May 30, 2018
2b9db4c
Update api diff to use precompiled version to avoid problems with mis…
marek-safar May 30, 2018
6565e83
Merge branch 'master' of github.com:xamarin/xamarin-macios into mono-…
marek-safar May 30, 2018
cdac931
Updates Compression Span overrides
marek-safar May 30, 2018
6623eae
Fixes mtouch build
marek-safar May 30, 2018
11df315
Fixes api-diff tool for mac to look up in the right folder for 4.5 de…
marek-safar May 30, 2018
a7d4139
Update tests to work with the latest linker enhancements
marek-safar May 30, 2018
e2226d8
More linker tests fixes
marek-safar May 31, 2018
a7cf7f3
Bump to mono/2018-04/e129a25c
alexischr Jun 3, 2018
a7d3ecc
More linker tests fixes
marek-safar Jun 13, 2018
c6f0aae
Merge remote-tracking branch 'origin/master' into mono-2018-04
marek-safar Jun 14, 2018
01435b4
Another linker tests update
marek-safar Jun 15, 2018
3deffe9
Fixes missing references path in update mac references
marek-safar Jun 18, 2018
8a5d2b2
Bumps mono
marek-safar Jun 18, 2018
eb2df73
Merge remote-tracking branch 'origin/master' into mono-2018-04
rolfbjarne Jun 19, 2018
9933ab0
Bump system mono to a version that has mono_runtime_set_pending_excep…
rolfbjarne Jun 19, 2018
3b083a2
More tests update for the linker
marek-safar Jun 19, 2018
7abb481
Bump to mono/2018-04/f22c8b706eb
alexischr Jun 19, 2018
fe4e0a4
Another mono bump
marek-safar Jun 25, 2018
28df496
Merge branch 'mono-2018-04' of github.com:xamarin/xamarin-macios into…
marek-safar Jun 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[submodule "external/mono"]
path = external/mono
url = ../../mono/mono.git
branch = 2018-02
branch = 2018-04
[submodule "external/opentk"]
path = external/opentk
url = ../../mono/opentk.git
Expand Down
6 changes: 3 additions & 3 deletions Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ XCODE_URL=http://xamarin-storage/bot-provisioning/xcodes/Xcode_9.4.xip
XCODE_DEVELOPER_ROOT=/Applications/Xcode94.app/Contents/Developer

# Minimum Mono version
MIN_MONO_VERSION=5.12.0.226
MAX_MONO_VERSION=5.12.99
MIN_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2018-02/192/9824e260f56eb08b163e2c79d3338cd946aad7d6/MonoFramework-MDK-5.12.0.226.macos10.xamarin.universal.pkg
MIN_MONO_VERSION=5.14.0.136
MAX_MONO_VERSION=5.14.99
MIN_MONO_URL=https://xamjenkinsartifact.azureedge.net/build-package-osx-mono/2018-04/111/07c8f25fe536dbb7e244f965aa3f9a871f41e953/MonoFramework-MDK-5.14.0.136.macos10.xamarin.universal.pkg

# Minimum Visual Studio version
MIN_VISUAL_STUDIO_URL=https://download.visualstudio.microsoft.com/download/pr/11550896/783d2219a348f93b6988fb415951788a/VisualStudioForMac-Preview-7.4.0.985.dmg
Expand Down
2 changes: 1 addition & 1 deletion external/mono
Submodule mono updated 1693 files
12 changes: 4 additions & 8 deletions src/Compression/Compression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ public override int Read (byte[] array, int offset, int count)
return ReadCore (new Span<byte> (array, offset, count));
}

// FIXME needs Span
internal override int Read (Span<byte> destination)
public override int Read (Span<byte> destination)
{
if (GetType () != typeof (CompressionStream)) {
// CompressStream is not sealed, and a derived type may have overridden Read(byte[], int, int) prior
Expand Down Expand Up @@ -313,8 +312,7 @@ public override Task<int> ReadAsync (byte[] array, int offset, int count, Cancel
return ReadAsyncMemory (new Memory<byte>(array, offset, count), cancellationToken).AsTask ();
}

// FIXME needs Span
internal override ValueTask<int> ReadAsync (Memory<byte> destination, CancellationToken cancellationToken = default(CancellationToken))
public override ValueTask<int> ReadAsync (Memory<byte> destination, CancellationToken cancellationToken = default(CancellationToken))
{
if (GetType () != typeof (CompressionStream)) {
// Ensure that existing streams derived from DeflateStream and that override ReadAsync(byte[],...)
Expand Down Expand Up @@ -407,8 +405,7 @@ public override void Write (byte[] array, int offset, int count)
WriteCore (new ReadOnlySpan<byte> (array, offset, count));
}

// FIXME needs Span
internal override void Write (ReadOnlySpan<byte> source)
public override void Write (ReadOnlySpan<byte> source)
{
if (GetType () != typeof (CompressionStream)) {
// DeflateStream is not sealed, and a derived type may have overridden Write(byte[], int, int) prior
Expand Down Expand Up @@ -561,8 +558,7 @@ public override Task WriteAsync (byte[] array, int offset, int count, Cancellati
return WriteAsyncMemory (new ReadOnlyMemory<byte> (array, offset, count), cancellationToken);
}

// FIXME needs Span
internal override Task WriteAsync (ReadOnlyMemory<byte> source, CancellationToken cancellationToken)
public override Task WriteAsync (ReadOnlyMemory<byte> source, CancellationToken cancellationToken)
{
if (GetType () != typeof (CompressionStream)) {
// Ensure that existing streams derived from DeflateStream and that override WriteAsync(byte[],...)
Expand Down
9 changes: 6 additions & 3 deletions tests/linker/ios/link all/AttributeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ static public bool Check ()
[Preserve (AllMembers = true)]
public class AttributeTest {

// Good enough to fool linker to abort the tracking
static string mscorlib = "mscorlib";

[Test]
public void DebugAssemblyAttributes ()
{
Expand Down Expand Up @@ -187,7 +190,7 @@ public void DebuggerTypeProxy_24203 ()
{
var d = new Dictionary<string,int> () { { "key", 0 } };
Assert.NotNull (d); // just to be 100% sure it won't be linked away (with the attribute we'll be looking for)
var proxy = Type.GetType ("System.Collections.Generic.Mscorlib_DictionaryDebugView`2, mscorlib");
var proxy = Type.GetType ("System.Collections.Generic.IDictionaryDebugView`2, " + mscorlib);
#if DEBUG
Assert.NotNull (proxy, "proxy");
// having the type is nice, but it must not be empty to be useful
Expand Down Expand Up @@ -226,8 +229,8 @@ public void SecurityDeclaration ()
// we ensure that we can create the type / call the code
Assert.True (SecurityDeclarationDecoratedUserCode.Check (), "call");
// we ensure that both the permission and the flag are NOT part of the final/linked binary (link all removes security declarations)
Assert.Null (Type.GetType ("System.Security.Permissions.FileIOPermissionAttribute, mscorlib"), "FileIOPermissionAttribute");
Assert.Null (Type.GetType ("System.Security.Permissions.FileIOPermissionAccess, mscorlib"), "FileIOPermissionAccess");
Assert.Null (Type.GetType ("System.Security.Permissions.FileIOPermissionAttribute, " + mscorlib), "FileIOPermissionAttribute");
Assert.Null (Type.GetType ("System.Security.Permissions.FileIOPermissionAccess, " + mscorlib), "FileIOPermissionAccess");
}
}
}
36 changes: 18 additions & 18 deletions tests/linker/ios/link all/LinkAllTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ public void DetectPlatform ()
{
#if !__WATCHOS__
// for (future) nunit[lite] platform detection - if this test fails then platform detection won't work
Assert.NotNull (Type.GetType (NamespacePrefix + "UIKit.UIApplicationDelegate, " + AssemblyName), "UIApplicationDelegate");
Assert.NotNull (Helper.GetType (NamespacePrefix + "UIKit.UIApplicationDelegate, " + AssemblyName), "UIApplicationDelegate");
#endif
// and you can trust the old trick with the linker
Assert.NotNull (Type.GetType ("Mono.Runtime"), "Mono.Runtime");
Assert.NotNull (Helper.GetType ("Mono.Runtime"), "Mono.Runtime");
}

[Test]
Expand All @@ -220,16 +220,16 @@ public void RemovedAttributes ()

// since we're linking the attributes will NOT be available - even if they are used
#if !XAMCORE_3_0
Assert.Null (Type.GetType (prefix + "ObjCRuntime.AvailabilityAttribute, " + suffix), "AvailabilityAttribute");
Assert.Null (Type.GetType (prefix + "ObjCRuntime.iOSAttribute, " + suffix), "AvailabilityAttribute");
Assert.Null (Type.GetType (prefix + "ObjCRuntime.AvailabilityAttribute, " + suffix), "AvailabilityAttribute");
Assert.Null (Type.GetType (prefix + "ObjCRuntime.SinceAttribute, " + suffix), "SinceAttribute");
Assert.Null (Helper.GetType (prefix + "ObjCRuntime.AvailabilityAttribute, " + suffix), "AvailabilityAttribute");
Assert.Null (Helper.GetType (prefix + "ObjCRuntime.iOSAttribute, " + suffix), "AvailabilityAttribute");
Assert.Null (Helper.GetType (prefix + "ObjCRuntime.AvailabilityAttribute, " + suffix), "AvailabilityAttribute");
Assert.Null (Helper.GetType (prefix + "ObjCRuntime.SinceAttribute, " + suffix), "SinceAttribute");
#endif
Assert.Null (Type.GetType (prefix + "ObjCRuntime.IntroducedAttribute, " + suffix), "IntroducedAttribute");
Assert.Null (Type.GetType (prefix + "ObjCRuntime.DeprecatedAttribute, " + suffix), "DeprecatedAttribute");
Assert.Null (Type.GetType (prefix + "ObjCRuntime.ObsoletedAttribute, " + suffix), "ObsoletedAttribute");
Assert.Null (Type.GetType (prefix + "ObjCRuntime.UnavailableAttribute, " + suffix), "UnavailableAttribute");
Assert.Null (Type.GetType (prefix + "ObjCRuntime.ThreadSafeAttribute, " + suffix), "ThreadSafeAttribute");
Assert.Null (Helper.GetType (prefix + "ObjCRuntime.IntroducedAttribute, " + suffix), "IntroducedAttribute");
Assert.Null (Helper.GetType (prefix + "ObjCRuntime.DeprecatedAttribute, " + suffix), "DeprecatedAttribute");
Assert.Null (Helper.GetType (prefix + "ObjCRuntime.ObsoletedAttribute, " + suffix), "ObsoletedAttribute");
Assert.Null (Helper.GetType (prefix + "ObjCRuntime.UnavailableAttribute, " + suffix), "UnavailableAttribute");
Assert.Null (Helper.GetType (prefix + "ObjCRuntime.ThreadSafeAttribute, " + suffix), "ThreadSafeAttribute");
}

[Test]
Expand Down Expand Up @@ -419,14 +419,14 @@ public void OpenTk10_Preserved ()
// Compiler optimization (roslyn release) can remove the variable, which removes OpenTK-1.dll from the app and fail the test
Assert.That (state, Is.EqualTo (OpenTK.WindowState.Normal), "normal");

var gl = Type.GetType ("OpenTK.Graphics.ES11.GL, OpenTK-1.0", false);
var gl = Helper.GetType ("OpenTK.Graphics.ES11.GL, OpenTK-1.0", false);
Assert.NotNull (gl, "ES11/GL");
var core = Type.GetType ("OpenTK.Graphics.ES11.GL/Core, OpenTK-1.0", false);
var core = Helper.GetType ("OpenTK.Graphics.ES11.GL/Core, OpenTK-1.0", false);
Assert.NotNull (core, "ES11/Core");

gl = Type.GetType ("OpenTK.Graphics.ES20.GL, OpenTK-1.0", false);
gl = Helper.GetType ("OpenTK.Graphics.ES20.GL, OpenTK-1.0", false);
Assert.NotNull (gl, "ES20/GL");
core = Type.GetType ("OpenTK.Graphics.ES20.GL/Core, OpenTK-1.0", false);
core = Helper.GetType ("OpenTK.Graphics.ES20.GL/Core, OpenTK-1.0", false);
Assert.NotNull (core, "ES20/Core");
}
#endif // !__WATCHOS__
Expand All @@ -435,7 +435,7 @@ public void OpenTk10_Preserved ()
public void NestedNSObject ()
{
// Parent type is not used - but it's not linked out
var p = Type.GetType ("LinkAll.Parent");
var p = Helper.GetType ("LinkAll.Parent");
Assert.NotNull (p, "Parent");
// because a nested type is a subclass of NSObject (and not part of monotouch.dll)
var n = p.GetNestedType ("Derived");
Expand Down Expand Up @@ -539,7 +539,7 @@ public void AppleTls ()
{
// make test work for classic (monotouch) and unified (iOS, tvOS and watchOS)
var fqn = typeof (NSObject).AssemblyQualifiedName.Replace ("Foundation.NSObject", "Security.Tls.AppleTlsProvider");
Assert.Null (Type.GetType (fqn), "Should NOT be included (no SslStream or Socket support)");
Assert.Null (Helper.GetType (fqn), "Should NOT be included (no SslStream or Socket support)");
}

[Test]
Expand All @@ -548,7 +548,7 @@ public void WebKit_NSProxy ()
{
// this test works only because "Link all" does not use WebKit
var fqn = typeof (NSObject).AssemblyQualifiedName.Replace ("Foundation.NSObject", "Foundation.NSProxy");
Assert.Null (Type.GetType (fqn), fqn);
Assert.Null (Helper.GetType (fqn), fqn);
}

static Type type_Task = typeof (Task);
Expand Down
20 changes: 18 additions & 2 deletions tests/linker/ios/link all/SerializationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@
#endif
using NUnit.Framework;

namespace LinkAll
{
static class Helper
{
public static Type GetType (string name)
{
return Type.GetType (name);
}

public static Type GetType (string typeName, bool throwOnError)
{
return Type.GetType (typeName, throwOnError);
}
}
}

namespace LinkAll.Serialization {

[Serializable]
Expand Down Expand Up @@ -75,7 +91,7 @@ public class SerializationAttributeTests {
public void UnusedType ()
{
// the serialization attributes only keeps the method(s) if the type was used
var t = Type.GetType ("LinkAll.Serialization.Unused");
var t = Helper.GetType ("LinkAll.Serialization.Unused");
// since it's not used in the app then it's removed by the linker
Assert.Null (t, "type");
}
Expand All @@ -84,7 +100,7 @@ public void UnusedType ()
public void UsedType ()
{
// the serialization attributes only keeps the method(s) if the type was used
var t = Type.GetType ("LinkAll.Serialization.Used");
var t = Helper.GetType ("LinkAll.Serialization.Used");
// since it's used here...
Assert.NotNull (new Used (), "reference");
// it's not removed by the linker
Expand Down
33 changes: 22 additions & 11 deletions tests/linker/ios/link sdk/LinkSdkRegressionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,14 @@ public void OpenTk_Preserved ()
#else
const string OpenTKAssembly = "OpenTK";
#endif
var gl = Type.GetType ("OpenTK.Graphics.ES11.GL, " + OpenTKAssembly, false);
var gl = GetTypeHelper ("OpenTK.Graphics.ES11.GL, " + OpenTKAssembly, false);
Assert.NotNull (gl, "ES11/GL");
var core = Type.GetType ("OpenTK.Graphics.ES11.GL/Core, " + OpenTKAssembly, false);
var core = GetTypeHelper ("OpenTK.Graphics.ES11.GL/Core, " + OpenTKAssembly, false);
Assert.NotNull (core, "ES11/Core");

gl = Type.GetType ("OpenTK.Graphics.ES20.GL, " + OpenTKAssembly, false);
gl = GetTypeHelper ("OpenTK.Graphics.ES20.GL, " + OpenTKAssembly, false);
Assert.NotNull (gl, "ES20/GL");
core = Type.GetType ("OpenTK.Graphics.ES20.GL/Core, " + OpenTKAssembly, false);
core = GetTypeHelper ("OpenTK.Graphics.ES20.GL/Core, " + OpenTKAssembly, false);
Assert.NotNull (core, "ES20/Core");
}
#endif // !__WATCHOS__
Expand Down Expand Up @@ -773,7 +773,7 @@ public void ForeignKey_650402 ()
public void Pointer_5200 ()
{
// ensure the linker did not remove the type, which is used by the runtime
Assert.NotNull (Type.GetType ("System.Reflection.Pointer, mscorlib"));
Assert.NotNull (GetTypeHelper ("System.Reflection.Pointer, mscorlib"));
}

[Test]
Expand Down Expand Up @@ -1065,8 +1065,8 @@ public void SecurityDeclaration ()
// we ensure that we can create the type / call the code
Assert.True (SecurityDeclarationDecoratedUserCode.Check (), "call");
// we ensure that both the permission and the flag are NOT part of the final/linked binary (link removes security declarations)
Assert.Null (Type.GetType ("System.Security.Permissions.FileIOPermissionAttribute, mscorlib"), "FileIOPermissionAttribute");
Assert.Null (Type.GetType ("System.Security.Permissions.FileIOPermissionAccess, mscorlib"), "FileIOPermissionAccess");
Assert.Null (GetTypeHelper ("System.Security.Permissions.FileIOPermissionAttribute, mscorlib"), "FileIOPermissionAttribute");
Assert.Null (GetTypeHelper ("System.Security.Permissions.FileIOPermissionAccess, mscorlib"), "FileIOPermissionAccess");
}

#if !__WATCHOS__
Expand Down Expand Up @@ -1094,7 +1094,7 @@ public void UIButtonSubclass ()
[Test]
public void MonoRuntime34671 ()
{
Assert.NotNull (Type.GetType ("Mono.Runtime"), "Mono.Runtime");
Assert.NotNull (GetTypeHelper ("Mono.Runtime"), "Mono.Runtime");
}

[Test]
Expand All @@ -1119,15 +1119,15 @@ public void OldTlsProvider_LinkedOut ()
{
// make test work for classic (monotouch) and unified (iOS, tvOS and watchOS)
var fqn = typeof (NSObject).AssemblyQualifiedName.Replace ("Foundation.NSObject", "Security.Tls.OldTlsProvider");
Assert.Null (Type.GetType (fqn), "Should not be included");
Assert.Null (GetTypeHelper (fqn), "Should not be included");
}

[Test]
public void AppleTls_Default ()
{
// make test work for classic (monotouch) and unified (iOS, tvOS and watchOS)
var fqn = typeof (NSObject).AssemblyQualifiedName.Replace ("Foundation.NSObject", "Security.Tls.AppleTlsProvider");
Assert.Null (Type.GetType (fqn), "Should be included");
Assert.Null (GetTypeHelper (fqn), "Should be included");
}

[Test]
Expand All @@ -1138,7 +1138,18 @@ public void WebKit_NSProxy ()
var t = typeof (WKWebView);
Assert.NotNull (t, "avoid compiler optimization of unused variable");
var fqn = typeof (NSObject).AssemblyQualifiedName.Replace ("Foundation.NSObject", "Foundation.NSProxy");
Assert.NotNull (Type.GetType (fqn), fqn);
Assert.NotNull (GetTypeHelper (fqn), fqn);
}

// Fools linker not to keep the type by using it in test check
static Type GetTypeHelper (string name)
{
return Type.GetType (name);
}

static Type GetTypeHelper (string name, bool throwOnError)
{
return Type.GetType (name, throwOnError);
}
}
}
5 changes: 4 additions & 1 deletion tests/mmptest/regression/common/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ public static TextWriter Log {
}
}

static string linker_removed_type = "MonoMac.CoreImage.CIColor, XamMac";

public static void EnsureLinker (bool enabled)
{
if ((Type.GetType ("MonoMac.CoreImage.CIColor, XamMac") != null) == enabled) {

if ((Type.GetType (linker_removed_type) != null) == enabled) {
Log.WriteLine ("[FAIL]\tThe linker was {0}enabled on this build", enabled ? "not " : String.Empty);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class CustomConverter : TypeConverter {
}

class TypeDescriptorTest {
static string typeToCheck = "Xamarin.Mac.Linker.Test.CustomConverter";

static void Check (string typeName)
{
Expand Down Expand Up @@ -57,7 +58,7 @@ static void Main (string[] args)
Check ("System.ComponentModel.CollectionConverter");
Check ("System.ComponentModel.EnumConverter");

var t = Type.GetType ("Xamarin.Mac.Linker.Test.CustomConverter", false);
var t = Type.GetType (typeToCheck, false);
Test.Log.WriteLine ("{0}\tXamarin.Mac.Linker.Test.CustomConverter", t == null ? "[PASS]" : "[FAIL]");

Test.Terminate ();
Expand Down
Loading