diff options
author | Marek Safar <marek.safar@gmail.com> | 2020-09-17 11:35:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-17 11:35:07 +0300 |
commit | cc5c0f934dd37330a6e7484aced73d93771fc324 (patch) | |
tree | 9c30d68cfb7634e5c8a9edcdd5a030c2b98b2a67 /test/Mono.Linker.Tests.Cases/DynamicDependencies | |
parent | 391d76f434873a823e4f3a0f4400636049b0327e (diff) |
Update to target .NET5 framework (#1471)
Co-authored-by: vitek-karas <vitek.karas@microsoft.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/DynamicDependencies')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.cs | 10 | ||||
-rw-r--r-- | test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.mono.Attributes.xml | 12 | ||||
-rw-r--r-- | test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.netcore.Attributes.xml (renamed from test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.Attributes.xml) | 2 |
3 files changed, 22 insertions, 2 deletions
diff --git a/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.cs b/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.cs index 8383e68aa..ea6fc7570 100644 --- a/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.cs +++ b/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.cs @@ -6,7 +6,15 @@ using Mono.Linker.Tests.Cases.Expectations.Metadata; namespace Mono.Linker.Tests.Cases.DynamicDependencies { - [SetupLinkAttributesFile ("DynamicDependencyFromAttributeXml.Attributes.xml")] + // For netcoreapp we don't have to specify the assembly for the attribute, since the attribute comes from corelib + // and will be found always. + // For mono though, we have to specify the assembly (Mono.Linker.Tests.Cases.Expectations) because at the time of processing + // that assembly is not yet loaded into the closure in the linker, so it won't find the attribute type. +#if NETCOREAPP + [SetupLinkAttributesFile ("DynamicDependencyFromAttributeXml.netcore.Attributes.xml")] +#else + [SetupLinkAttributesFile ("DynamicDependencyFromAttributeXml.mono.Attributes.xml")] +#endif [IgnoreLinkAttributes (false)] class DynamicDependencyFromAttributeXml { diff --git a/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.mono.Attributes.xml b/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.mono.Attributes.xml new file mode 100644 index 000000000..cbf1c08ba --- /dev/null +++ b/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.mono.Attributes.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<linker> + <assembly fullname="test, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"> + <type fullname="Mono.Linker.Tests.Cases.DynamicDependencies.DynamicDependencyFromAttributeXml"> + <method name="DependencyToUnusedMethod"> + <attribute fullname="System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute" assembly="Mono.Linker.Tests.Cases.Expectations"> + <argument>UnusedMethod</argument> + </attribute> + </method> + </type> + </assembly> +</linker>
\ No newline at end of file diff --git a/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.Attributes.xml b/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.netcore.Attributes.xml index ce3e630b1..3d7f8cce5 100644 --- a/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.Attributes.xml +++ b/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyFromAttributeXml.netcore.Attributes.xml @@ -3,7 +3,7 @@ <assembly fullname="test, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"> <type fullname="Mono.Linker.Tests.Cases.DynamicDependencies.DynamicDependencyFromAttributeXml"> <method name="DependencyToUnusedMethod"> - <attribute fullname="System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute" assembly="Mono.Linker.Tests.Cases.Expectations"> + <attribute fullname="System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute"> <argument>UnusedMethod</argument> </attribute> </method> |