Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2017-08-22 01:40:15 +0300
committerMarek Safar <marek.safar@gmail.com>2017-08-24 00:59:33 +0300
commit9fc2a24b5fc389a3bc3bde85efa1e39b43f1fce0 (patch)
tree52f2a9b19fa27b5b49158527ee9a9148946c172f /linker/Tests/Mono.Linker.Tests.Cases.Expectations
parent07b07ef75fa1858253af45af6fe30812a5a1655c (diff)
Adds more type-forwarder tests
Diffstat (limited to 'linker/Tests/Mono.Linker.Tests.Cases.Expectations')
-rw-r--r--linker/Tests/Mono.Linker.Tests.Cases.Expectations/Assertions/RemovedForwarderAttribute.cs15
-rw-r--r--linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/CoreLinkAttribute.cs13
-rw-r--r--linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupLinkerActionAttribute.cs18
-rw-r--r--linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/SetupLinkerCoreActionAttribute.cs20
-rw-r--r--linker/Tests/Mono.Linker.Tests.Cases.Expectations/Mono.Linker.Tests.Cases.Expectations.csproj4
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.