diff options
Diffstat (limited to 'linker/Tests/Mono.Linker.Tests.Cases.Expectations')
5 files changed, 56 insertions, 14 deletions
diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedForwarderAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedForwarderAttribute.cs new file mode 100644 index 000000000..645a01bdc --- /dev/null +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedForwarderAttribute.cs @@ -0,0 +1,15 @@ +using System; +namespace Mono.Linker.Tests.Cases.Expectations.Assertions +{ + [AttributeUsage (AttributeTargets.Class, AllowMultiple = true, Inherited = false)] + public class RemovedForwarderAttribute : BaseInAssemblyAttribute + { + public RemovedForwarderAttribute (string assemblyFileName, string typeName) + { + if (string.IsNullOrEmpty (assemblyFileName)) + throw new ArgumentException ("Value cannot be null or empty.", nameof (assemblyFileName)); + if (string.IsNullOrEmpty (typeName)) + throw new ArgumentException ("Value cannot be null or empty.", nameof (typeName)); + } + } +} diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/CoreLinkAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/CoreLinkAttribute.cs deleted file mode 100644 index e287d5a56..000000000 --- a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/CoreLinkAttribute.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace Mono.Linker.Tests.Cases.Expectations.Metadata { - [AttributeUsage (AttributeTargets.Class)] - public class CoreLinkAttribute : BaseMetadataAttribute { - - public CoreLinkAttribute (string value) - { - if (string.IsNullOrEmpty (value)) - throw new ArgumentException ("Value cannot be null or empty.", nameof (value)); - } - } -}
\ No newline at end of file diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupLinkerActionAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupLinkerActionAttribute.cs new file mode 100644 index 000000000..d0d68193e --- /dev/null +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupLinkerActionAttribute.cs @@ -0,0 +1,18 @@ +using System; + +namespace Mono.Linker.Tests.Cases.Expectations.Metadata +{ + [AttributeUsage (AttributeTargets.Class, AllowMultiple = true)] + public class SetupLinkerActionAttribute : BaseMetadataAttribute + { + public SetupLinkerActionAttribute (string action, string assembly) + { + switch (action) { + case "link": case "copy": case "skip": + break; + default: + throw new ArgumentOutOfRangeException (nameof (action)); + } + } + } +} diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupLinkerCoreActionAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupLinkerCoreActionAttribute.cs new file mode 100644 index 000000000..c60bc59b2 --- /dev/null +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupLinkerCoreActionAttribute.cs @@ -0,0 +1,20 @@ +using System; + +namespace Mono.Linker.Tests.Cases.Expectations.Metadata +{ + [AttributeUsage (AttributeTargets.Class, AllowMultiple = false)] + public class SetupLinkerCoreActionAttribute : BaseMetadataAttribute + { + public SetupLinkerCoreActionAttribute (string action) + { + switch (action) { + case "link": + case "copy": + case "skip": + break; + default: + throw new ArgumentOutOfRangeException (nameof (action)); + } + } + } +} diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Mono.Linker.Tests.Cases.Expectations.csproj b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Mono.Linker.Tests.Cases.Expectations.csproj index 20c4a9479..5c063734c 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Mono.Linker.Tests.Cases.Expectations.csproj +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Mono.Linker.Tests.Cases.Expectations.csproj @@ -53,7 +53,6 @@ <Compile Include="Metadata\BaseMetadataAttribute.cs" /> <Compile Include="Metadata\SetupCompileAfterAttribute.cs" /> <Compile Include="Metadata\SetupCompileBeforeAttribute.cs" /> - <Compile Include="Metadata\CoreLinkAttribute.cs" /> <Compile Include="Metadata\DefineAttribute.cs" /> <Compile Include="Metadata\IncludeBlacklistStepAttribute.cs" /> <Compile Include="Metadata\Il8nAttribute.cs" /> @@ -64,6 +63,9 @@ <Compile Include="Assertions\KeptBaseTypeAttribute.cs" /> <Compile Include="Assertions\KeptInterfaceAttribute.cs" /> <Compile Include="Assertions\KeptAttributeAttribute.cs" /> + <Compile Include="Assertions\RemovedForwarderAttribute.cs" /> + <Compile Include="Metadata\SetupLinkerActionAttribute.cs" /> + <Compile Include="Metadata\SetupLinkerCoreActionAttribute.cs" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. |