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:
authorMike Voorhees <michaelv@unity3d.com>2017-08-17 20:23:13 +0300
committerMarek Safar <marek.safar@gmail.com>2017-08-18 12:40:49 +0300
commita8d0bbe7e6503dd1798a99b785d18aaaaea34d28 (patch)
tree112ab2068b0b9d52263bea509432ef40185a9a0d /linker/Tests
parent2ed84d2fe02981a7115a522b7c06587aedcec61c (diff)
Testing support for adding the KeepTypeForwarderOnlyAssemblies
KeepTypeForwarder arg handling fix.
Diffstat (limited to 'linker/Tests')
-rw-r--r--linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/KeepTypeForwarderOnlyAssembliesAttribute.cs12
-rw-r--r--linker/Tests/Mono.Linker.Tests.Cases.Expectations/Mono.Linker.Tests.Cases.Expectations.csproj1
-rw-r--r--linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs9
-rw-r--r--linker/Tests/TestCasesRunner/TestCaseLinkerOptions.cs2
-rw-r--r--linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs6
5 files changed, 27 insertions, 3 deletions
diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/KeepTypeForwarderOnlyAssembliesAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/KeepTypeForwarderOnlyAssembliesAttribute.cs
new file mode 100644
index 000000000..ef00ca5f5
--- /dev/null
+++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/KeepTypeForwarderOnlyAssembliesAttribute.cs
@@ -0,0 +1,12 @@
+using System;
+
+namespace Mono.Linker.Tests.Cases.Expectations.Metadata {
+ [AttributeUsage (AttributeTargets.Class)]
+ public sealed class KeepTypeForwarderOnlyAssembliesAttribute : BaseMetadataAttribute {
+ public KeepTypeForwarderOnlyAssembliesAttribute (string value)
+ {
+ if (string.IsNullOrEmpty (value))
+ throw new ArgumentException ("Value cannot be null or empty.", nameof (value));
+ }
+ }
+}
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 a18529218..fb1b6e3e1 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
@@ -54,6 +54,7 @@
<Compile Include="Metadata\CoreLinkAttribute.cs" />
<Compile Include="Metadata\IncludeBlacklistStepAttribute.cs" />
<Compile Include="Metadata\Il8nAttribute.cs" />
+ <Compile Include="Metadata\KeepTypeForwarderOnlyAssembliesAttribute.cs" />
<Compile Include="Metadata\NotATestCaseAttribute.cs" />
<Compile Include="Metadata\ReferenceAttribute.cs" />
<Compile Include="Metadata\SandboxDependencyAttribute.cs" />
diff --git a/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs b/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs
index 637056a6f..ce86808c7 100644
--- a/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs
+++ b/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs
@@ -41,6 +41,12 @@ namespace Mono.Linker.Tests.TestCasesRunner {
Append (value);
}
+ public virtual void AddKeepTypeForwarderOnlyAssemblies (string value)
+ {
+ if (bool.Parse (value))
+ Append ("-t");
+ }
+
public string [] ToArgs ()
{
return _arguments.ToArray ();
@@ -62,6 +68,9 @@ namespace Mono.Linker.Tests.TestCasesRunner {
// Internationalization assemblies pollute our test case results as well so disable them
if (!string.IsNullOrEmpty (options.Il8n))
AddIl8n (options.Il8n);
+
+ if (!string.IsNullOrEmpty (options.KeepTypeForwarderOnlyAssemblies))
+ AddKeepTypeForwarderOnlyAssemblies (options.KeepTypeForwarderOnlyAssemblies);
}
}
} \ No newline at end of file
diff --git a/linker/Tests/TestCasesRunner/TestCaseLinkerOptions.cs b/linker/Tests/TestCasesRunner/TestCaseLinkerOptions.cs
index a50164357..4fdb8dee2 100644
--- a/linker/Tests/TestCasesRunner/TestCaseLinkerOptions.cs
+++ b/linker/Tests/TestCasesRunner/TestCaseLinkerOptions.cs
@@ -1,9 +1,9 @@
namespace Mono.Linker.Tests.TestCasesRunner {
-
public class TestCaseLinkerOptions
{
public string CoreLink;
public string Il8n;
public bool IncludeBlacklistStep;
+ public string KeepTypeForwarderOnlyAssemblies;
}
} \ No newline at end of file
diff --git a/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs b/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs
index 1a6e96312..8055cfccb 100644
--- a/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs
+++ b/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs
@@ -26,10 +26,12 @@ namespace Mono.Linker.Tests.TestCasesRunner {
public virtual TestCaseLinkerOptions GetLinkerOptions ()
{
- return new TestCaseLinkerOptions {
+ return new TestCaseLinkerOptions
+ {
CoreLink = GetOptionAttributeValue (nameof (CoreLinkAttribute), "skip"),
Il8n = GetOptionAttributeValue (nameof (Il8nAttribute), string.Empty),
- IncludeBlacklistStep = GetOptionAttributeValue (nameof (IncludeBlacklistStepAttribute), false)
+ IncludeBlacklistStep = GetOptionAttributeValue (nameof (IncludeBlacklistStepAttribute), false),
+ KeepTypeForwarderOnlyAssemblies = GetOptionAttributeValue (nameof (KeepTypeForwarderOnlyAssembliesAttribute), string.Empty)
};
}