diff options
author | Mike Voorhees <michaelv@unity3d.com> | 2017-05-12 15:55:42 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-05-12 18:00:08 +0300 |
commit | c07e471e1008198eadf833164f46c2ef3b40c4fa (patch) | |
tree | 7f4cf02e772bd33402add8de8c64221c3ca84671 /linker/Tests/Mono.Linker.Tests.Cases.Expectations | |
parent | a5f27ed4fe21b4299aad63364475e615afe2dd3d (diff) |
Improve assembly resolution in ResultChecker
Add support for string type name in *InAssemblyAttributes so that non-public types can be checked
Diffstat (limited to 'linker/Tests/Mono.Linker.Tests.Cases.Expectations')
4 files changed, 35 insertions, 9 deletions
diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptMemberInAssemblyAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptMemberInAssemblyAttribute.cs index 31dd5131d..9d658219a 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptMemberInAssemblyAttribute.cs +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptMemberInAssemblyAttribute.cs @@ -5,13 +5,20 @@ namespace Mono.Linker.Tests.Cases.Expectations.Assertions { [AttributeUsage (AttributeTargets.Class | AttributeTargets.Delegate, AllowMultiple = true, Inherited = false)] public class KeptMemberInAssemblyAttribute : BaseExpectedLinkedBehaviorAttribute { public readonly string AssemblyFileName; - public readonly Type Type; + public readonly string TypeName; public readonly string [] MemberNames; public KeptMemberInAssemblyAttribute (string assemblyFileName, Type type, params string [] memberNames) { AssemblyFileName = assemblyFileName; - Type = type; + TypeName = type.ToString (); + MemberNames = memberNames; + } + + public KeptMemberInAssemblyAttribute (string assemblyFileName, string typeName, params string [] memberNames) + { + AssemblyFileName = assemblyFileName; + TypeName = typeName; MemberNames = memberNames; } } diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs index f4725f9b9..2e0171a83 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/KeptTypeInAssemblyAttribute.cs @@ -6,12 +6,18 @@ namespace Mono.Linker.Tests.Cases.Expectations.Assertions public class KeptTypeInAssemblyAttribute : BaseExpectedLinkedBehaviorAttribute { public readonly string AssemblyFileName; - public readonly Type Type; + public readonly string TypeName; - public KeptTypeInAssemblyAttribute(string assemblyFileName, Type type) + public KeptTypeInAssemblyAttribute (string assemblyFileName, Type type) { AssemblyFileName = assemblyFileName; - Type = type; + TypeName = type.ToString (); + } + + public KeptTypeInAssemblyAttribute (string assemblyFileName, string typeName) + { + AssemblyFileName = assemblyFileName; + TypeName = typeName; } } } diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedMemberInAssemblyAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedMemberInAssemblyAttribute.cs index 3bcd63b9d..c19794184 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedMemberInAssemblyAttribute.cs +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedMemberInAssemblyAttribute.cs @@ -4,13 +4,20 @@ namespace Mono.Linker.Tests.Cases.Expectations.Assertions { [AttributeUsage (AttributeTargets.Class | AttributeTargets.Delegate, AllowMultiple = true, Inherited = false)] public class RemovedMemberInAssemblyAttribute : BaseExpectedLinkedBehaviorAttribute { public readonly string AssemblyFileName; - public readonly Type Type; + public readonly string TypeName; public readonly string [] MemberNames; public RemovedMemberInAssemblyAttribute (string assemblyFileName, Type type, params string [] memberNames) { AssemblyFileName = assemblyFileName; - Type = type; + TypeName = type.ToString (); + MemberNames = memberNames; + } + + public RemovedMemberInAssemblyAttribute (string assemblyFileName, string typeName, params string [] memberNames) + { + AssemblyFileName = assemblyFileName; + TypeName = typeName; MemberNames = memberNames; } } diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedTypeInAssemblyAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedTypeInAssemblyAttribute.cs index 04bc9c132..a56eee32a 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedTypeInAssemblyAttribute.cs +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedTypeInAssemblyAttribute.cs @@ -5,12 +5,18 @@ namespace Mono.Linker.Tests.Cases.Expectations.Assertions [AttributeUsage(AttributeTargets.Class | AttributeTargets.Delegate, AllowMultiple = true, Inherited = false)] public class RemovedTypeInAssemblyAttribute : BaseExpectedLinkedBehaviorAttribute { public readonly string AssemblyFileName; - public readonly Type Type; + public readonly string TypeName; public RemovedTypeInAssemblyAttribute (string assemblyFileName, Type type) { AssemblyFileName = assemblyFileName; - Type = type; + TypeName = type.ToString (); + } + + public RemovedTypeInAssemblyAttribute (string assemblyFileName, string typeName) + { + AssemblyFileName = assemblyFileName; + TypeName = typeName; } } } |