diff options
Diffstat (limited to 'linker')
5 files changed, 15 insertions, 16 deletions
diff --git a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/IncludeBlacklistStepAttribute.cs b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/IncludeBlacklistStepAttribute.cs index 09512704b..4144abcf6 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/IncludeBlacklistStepAttribute.cs +++ b/linker/Tests/Mono.Linker.Tests.Cases.Expectations/Metadata/IncludeBlacklistStepAttribute.cs @@ -1,8 +1,8 @@ namespace Mono.Linker.Tests.Cases.Expectations.Metadata { public sealed class IncludeBlacklistStepAttribute : BaseMetadataAttribute { - public readonly string Value; + public readonly bool Value; - public IncludeBlacklistStepAttribute (string value) + public IncludeBlacklistStepAttribute (bool value) { Value = value; } diff --git a/linker/Tests/Mono.Linker.Tests.Cases/References/ReferencesAreRemovedWhenAllUsagesAreRemoved.cs b/linker/Tests/Mono.Linker.Tests.Cases/References/ReferencesAreRemovedWhenAllUsagesAreRemoved.cs index 2cc3f5c0d..d54ba5c21 100644 --- a/linker/Tests/Mono.Linker.Tests.Cases/References/ReferencesAreRemovedWhenAllUsagesAreRemoved.cs +++ b/linker/Tests/Mono.Linker.Tests.Cases/References/ReferencesAreRemovedWhenAllUsagesAreRemoved.cs @@ -6,8 +6,7 @@ namespace Mono.Linker.Tests.Cases.References { [CoreLink ("link")] // Il8n & the blacklist step pollute the results with extra stuff that didn't need to be // preserved for this test case so we need to disable them - [Il8n("none")] - [IncludeBlacklistStep("false")] + [Il8n ("none")] [Reference ("System.dll")] [RemovedAssembly ("System.dll")] // Can be removed once this bug is fixed https://bugzilla.xamarin.com/show_bug.cgi?id=58168 diff --git a/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs b/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs index 4c2a4e5a5..637056a6f 100644 --- a/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs +++ b/linker/Tests/TestCasesRunner/LinkerArgumentBuilder.cs @@ -29,10 +29,10 @@ namespace Mono.Linker.Tests.TestCasesRunner { Append (value); } - public virtual void IncludeBlacklist (string value) + public virtual void IncludeBlacklist (bool value) { Append ("-z"); - Append (value); + Append (value ? "true" : "false"); } public virtual void AddIl8n (string value) @@ -57,8 +57,7 @@ namespace Mono.Linker.Tests.TestCasesRunner { // Running the blacklist step causes a ton of stuff to be preserved. That's good for normal use cases, but for // our test cases that pollutes the results - if (!string.IsNullOrEmpty (options.IncludeBlacklistStep)) - IncludeBlacklist (options.IncludeBlacklistStep); + IncludeBlacklist (options.IncludeBlacklistStep); // Internationalization assemblies pollute our test case results as well so disable them if (!string.IsNullOrEmpty (options.Il8n)) diff --git a/linker/Tests/TestCasesRunner/TestCaseLinkerOptions.cs b/linker/Tests/TestCasesRunner/TestCaseLinkerOptions.cs index 599c97e08..a50164357 100644 --- a/linker/Tests/TestCasesRunner/TestCaseLinkerOptions.cs +++ b/linker/Tests/TestCasesRunner/TestCaseLinkerOptions.cs @@ -1,7 +1,9 @@ namespace Mono.Linker.Tests.TestCasesRunner { - public class TestCaseLinkerOptions { + + public class TestCaseLinkerOptions + { public string CoreLink; public string Il8n; - public string IncludeBlacklistStep; + public bool IncludeBlacklistStep; } }
\ No newline at end of file diff --git a/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs b/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs index 67eb9814c..1a6e96312 100644 --- a/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs +++ b/linker/Tests/TestCasesRunner/TestCaseMetadaProvider.cs @@ -26,12 +26,11 @@ namespace Mono.Linker.Tests.TestCasesRunner { public virtual TestCaseLinkerOptions GetLinkerOptions () { - // This will end up becoming more complicated as we get into more complex test cases that require additional - // data - var coreLink = GetOptionAttributeValue (nameof (CoreLinkAttribute), "skip"); - var il8n = GetOptionAttributeValue (nameof (Il8nAttribute), string.Empty); - var blacklist = GetOptionAttributeValue (nameof (IncludeBlacklistStepAttribute), string.Empty); - return new TestCaseLinkerOptions {CoreLink = coreLink, Il8n = il8n, IncludeBlacklistStep = blacklist}; + return new TestCaseLinkerOptions { + CoreLink = GetOptionAttributeValue (nameof (CoreLinkAttribute), "skip"), + Il8n = GetOptionAttributeValue (nameof (Il8nAttribute), string.Empty), + IncludeBlacklistStep = GetOptionAttributeValue (nameof (IncludeBlacklistStepAttribute), false) + }; } public virtual IEnumerable<string> GetReferencedAssemblies (NPath workingDirectory) |