diff options
author | Sven Boemer <sbomer@gmail.com> | 2022-09-19 20:49:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-19 20:49:24 +0300 |
commit | fda9d062dea827a19f1eae5cb2a0adbc63cba483 (patch) | |
tree | e378b06f03fae3d159802ee056f46f91f105ba90 /test | |
parent | ddc7da6775ddeb2538bc327011867f65deb4c6f0 (diff) |
Remove --keep-facades option (#3036)
* Remove --keep-facades option
Diffstat (limited to 'test')
38 files changed, 10 insertions, 145 deletions
diff --git a/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/ReferencesTests.g.cs b/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/ReferencesTests.g.cs index 5c91dd7ca..8d7750a09 100644 --- a/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/ReferencesTests.g.cs +++ b/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/ReferencesTests.g.cs @@ -16,12 +16,6 @@ namespace ILLink.RoslynAnalyzer.Tests } [Fact] - public Task AssemblyOnlyUsedByUsingWithCscWithKeepFacades () - { - return RunTest (allowMissingWarnings: true); - } - - [Fact] public Task AssemblyReferenceIsRemovedWhenUnused () { return RunTest (allowMissingWarnings: true); diff --git a/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/TypeForwardingTests.g.cs b/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/TypeForwardingTests.g.cs index b1400dde9..1b2bb4b15 100644 --- a/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/TypeForwardingTests.g.cs +++ b/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/TypeForwardingTests.g.cs @@ -28,7 +28,7 @@ namespace ILLink.RoslynAnalyzer.Tests } [Fact] - public Task TypeForwarderOnlyAssembliesKept () + public Task TypeForwarderOnlyAssembliesRemoved () { return RunTest (allowMissingWarnings: true); } diff --git a/test/Mono.Linker.Tests.Cases.Expectations/Metadata/KeepTypeForwarderOnlyAssembliesAttribute.cs b/test/Mono.Linker.Tests.Cases.Expectations/Metadata/KeepTypeForwarderOnlyAssembliesAttribute.cs deleted file mode 100644 index e386d3502..000000000 --- a/test/Mono.Linker.Tests.Cases.Expectations/Metadata/KeepTypeForwarderOnlyAssembliesAttribute.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -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/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeWithTypeForwarderIsRemoved.cs b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeWithTypeForwarderIsRemoved.cs index 52afdeaae..2e74a3b25 100644 --- a/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeWithTypeForwarderIsRemoved.cs +++ b/test/Mono.Linker.Tests.Cases/Attributes/OnlyKeepUsed/UnusedAttributeWithTypeForwarderIsRemoved.cs @@ -5,13 +5,12 @@ using Mono.Linker.Tests.Cases.Expectations.Metadata; namespace Mono.Linker.Tests.Cases.Attributes.OnlyKeepUsed { - [KeepTypeForwarderOnlyAssemblies ("true")] [SetupLinkerArgument ("--used-attrs-only", "true")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/UnusedAttributeWithTypeForwarderIsRemoved_Lib.cs" })] [SetupCompileAfter ("implementation.dll", new[] { "Dependencies/UnusedAttributeWithTypeForwarderIsRemoved_Lib.cs" })] [SetupCompileAfter ("library.dll", new[] { "Dependencies/UnusedAttributeWithTypeForwarderIsRemoved_Forwarder.cs" }, new[] { "implementation.dll" })] - [RemovedTypeInAssembly ("library.dll", typeof (UnusedAttributeWithTypeForwarderIsRemoved_LibAttribute))] + [RemovedAssembly ("library.dll")] [RemovedTypeInAssembly ("implementation.dll", typeof (UnusedAttributeWithTypeForwarderIsRemoved_LibAttribute))] class UnusedAttributeWithTypeForwarderIsRemoved { diff --git a/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyOnForwardedType.cs b/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyOnForwardedType.cs index 95ca79466..ec828c82c 100644 --- a/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyOnForwardedType.cs +++ b/test/Mono.Linker.Tests.Cases/DynamicDependencies/DynamicDependencyOnForwardedType.cs @@ -16,6 +16,7 @@ namespace Mono.Linker.Tests.Cases.DynamicDependencies [SetupCompileBefore ("FacadeAssembly.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" })] [SetupCompileAfter ("ImplementationLibrary.dll", new[] { "Dependencies/ImplementationLibrary.cs" })] [SetupCompileAfter ("FacadeAssembly.dll", new[] { "Dependencies/FacadeAssembly.cs" }, new[] { "ImplementationLibrary.dll" })] + [KeptAssembly ("FacadeAssembly.dll")] [LogDoesNotContain ("IL2036")] public class DynamicDependencyOnForwardedType { diff --git a/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveAnExportedType.cs b/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveAnExportedType.cs index b083b446f..da65cb35c 100644 --- a/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveAnExportedType.cs +++ b/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveAnExportedType.cs @@ -5,7 +5,6 @@ using Mono.Linker.Tests.Cases.LinkXml.Dependencies; namespace Mono.Linker.Tests.Cases.LinkXml { - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Library.dll", new[] { "Dependencies/CanPreserveAnExportedType_Library.cs" })] // Add another assembly in that uses the forwarder just to make things a little more complex [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/CanPreserveAnExportedType_Forwarder.cs" }, references: new[] { "Library.dll" })] diff --git a/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveExportedTypesUsingRegex.cs b/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveExportedTypesUsingRegex.cs index d84f952a0..8252d109e 100644 --- a/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveExportedTypesUsingRegex.cs +++ b/test/Mono.Linker.Tests.Cases/LinkXml/CanPreserveExportedTypesUsingRegex.cs @@ -5,7 +5,6 @@ using Mono.Linker.Tests.Cases.LinkXml.Dependencies; namespace Mono.Linker.Tests.Cases.LinkXml { - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Library.dll", new[] { "Dependencies/CanPreserveAnExportedType_Library.cs" })] // Add another assembly in that uses the forwarder just to make things a little more complex [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/CanPreserveAnExportedType_Forwarder.cs" }, references: new[] { "Library.dll" })] diff --git a/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCsc.cs b/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCsc.cs index 75c930d64..bc607d441 100644 --- a/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCsc.cs +++ b/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCsc.cs @@ -10,7 +10,6 @@ namespace Mono.Linker.Tests.Cases.References /// Because of that, `copied` needs to have it's reference to `library` removed even though we specified an assembly action of `copy` /// </summary> [SetupLinkerAction ("copy", "copied")] - [SetupLinkerArgument ("--keep-facades", "false")] [SetupCompileBefore ("library.dll", new[] { "Dependencies/AssemblyOnlyUsedByUsing_Lib.cs" })] // When csc is used, `copied.dll` will have a reference to `library.dll` diff --git a/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCscWithKeepFacades.cs b/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCscWithKeepFacades.cs deleted file mode 100644 index 3be6aa4e7..000000000 --- a/test/Mono.Linker.Tests.Cases/References/AssemblyOnlyUsedByUsingWithCscWithKeepFacades.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Mono.Linker.Tests.Cases.Expectations.Assertions; -using Mono.Linker.Tests.Cases.Expectations.Helpers; -using Mono.Linker.Tests.Cases.Expectations.Metadata; -using Mono.Linker.Tests.Cases.References.Dependencies; - -namespace Mono.Linker.Tests.Cases.References -{ - /// <summary> - /// We can't detect the using usage in the assembly. As a result, nothing in `library` is going to be marked and that assembly will be deleted. - /// Because of that, `copied` needs to have it's reference to `library` removed even though we specified an assembly action of `copy` - /// </summary> - [SetupLinkerAction ("copy", "copied")] - - // --keep-facades sends the sweep step down a different code path that caused problems for this corner case - [SetupLinkerArgument ("--keep-facades", "true")] - [SetupCompileBefore ("library.dll", new[] { "Dependencies/AssemblyOnlyUsedByUsing_Lib.cs" })] - - // When csc is used, `copied.dll` will have a reference to `library.dll` - [SetupCompileBefore ("copied.dll", new[] { "Dependencies/AssemblyOnlyUsedByUsing_Copied.cs" }, new[] { "library.dll" }, compilerToUse: "csc")] - - // Here to assert that the test is setup correctly to copy the copied assembly. This is an important aspect of the bug - [KeptMemberInAssembly ("copied.dll", typeof (AssemblyOnlyUsedByUsing_Copied), "Unused()")] - - // We library should be gone. The `using` statement leaves no traces in the IL so nothing in `library` will be marked - [RemovedAssembly ("library.dll")] - [KeptReferencesInAssembly ("copied.dll", new[] { "System.Runtime", "library" })] - public class AssemblyOnlyUsedByUsingWithCscWithKeepFacades - { - public static void Main () - { - // Use something to keep the reference at compile time - AssemblyOnlyUsedByUsing_Copied.UsedToKeepReference (); - } - } -}
\ No newline at end of file diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwarded.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwarded.cs index b0efefb6a..f9f456803 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwarded.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwarded.cs @@ -8,7 +8,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding // Actions: // link - This assembly, Forwarder.dll and Implementation.dll [SetupLinkerDefaultAction ("link")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwardedWithCopyAction.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwardedWithCopyAction.cs index 71e154036..486484595 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwardedWithCopyAction.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributeArgumentForwardedWithCopyAction.cs @@ -15,7 +15,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding [SetupLinkerDefaultAction ("link")] [SetupLinkerAction ("copy", "test")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs index 809d0225f..572903750 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/AttributesScopeUpdated.cs @@ -11,7 +11,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding [SetupLinkerDefaultAction ("link")] [SetupLinkerAction ("copy", "test")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs index b0a7e0144..96d49426c 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/SecurityAttributeScope.cs @@ -15,7 +15,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding [SetupLinkerArgument ("--skip-unresolved", "true")] [SetupLinkerArgument ("--strip-security", "false")] [Define ("IL_ASSEMBLY_AVAILABLE")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupLinkerAction ("copy", "Library")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/SecurityAttributeForwarderLibrary.cs" })] [SetupCompileBefore ("Library.dll", new[] { "Dependencies/LibraryWithSecurityAttributes.il" }, new[] { "Forwarder.dll" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs index a5e019cb0..cb60d79e9 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardedIsUpdatedForMissingType.cs @@ -5,7 +5,6 @@ using Mono.Linker.Tests.Cases.Expectations.Metadata; namespace Mono.Linker.Tests.Cases.TypeForwarding { [SkipUnresolved (true)] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Lib.dll", new[] { "Dependencies/TypeForwardedIsUpdatedForMissingTypeLib.cs" })] [SetupCompileBefore ("AnotherLibrary.dll", new[] { "Dependencies/TypeForwardedIsUpdatedForMissingTypeLib2.cs" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssembliesKept.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssembliesRemoved.cs index 407cdab90..929a297f6 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssembliesKept.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssembliesRemoved.cs @@ -5,7 +5,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies; namespace Mono.Linker.Tests.Cases.TypeForwarding { - [KeepTypeForwarderOnlyAssemblies ("true")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] // Add another assembly in that uses the forwarder just to make things a little more complex [SetupCompileBefore ("Library.dll", new[] { "Dependencies/LibraryUsingForwarder.cs" }, references: new[] { "Forwarder.dll" })] @@ -14,10 +13,10 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding [SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })] [SetupCompileAfter ("Forwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "Implementation.dll" })] - [KeptAssembly ("Forwarder.dll")] + [RemovedAssembly ("Forwarder.dll")] [KeptMemberInAssembly ("Library.dll", typeof (LibraryUsingForwarder), "GetValueFromOtherAssembly()")] [KeptMemberInAssembly ("Implementation.dll", typeof (ImplementationLibrary), "GetSomeValue()")] - public class TypeForwarderOnlyAssembliesKept + public class TypeForwarderOnlyAssembliesRemoved { public static void Main () { diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssemblyCanBePreservedViaLinkXml.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssemblyCanBePreservedViaLinkXml.cs index d0fe5a6d0..5b0b41549 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssemblyCanBePreservedViaLinkXml.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwarderOnlyAssemblyCanBePreservedViaLinkXml.cs @@ -5,7 +5,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies; namespace Mono.Linker.Tests.Cases.TypeForwarding { - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] // Add another assembly in that uses the forwarder just to make things a little more complex [SetupCompileBefore ("Library.dll", new[] { "Dependencies/LibraryUsingForwarder.cs" }, references: new[] { "Forwarder.dll" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs index c3d0dc212..193bb4e97 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersModifiers.cs @@ -8,7 +8,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding // Actions: // link - This assembly, TypeForwarderModifiersLibDef.dll and TypeForwardersModifiersLib.dll [SetupLinkerDefaultAction ("link")] - [KeepTypeForwarderOnlyAssemblies ("false")] [Define ("IL_ASSEMBLY_AVAILABLE")] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs index 754d2c282..240f36543 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/TypeForwardersRewrite.cs @@ -6,7 +6,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding { // Actions: // link - This assembly, Forwarder.dll and Implementation.dll - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupLinkerArgument ("--skip-unresolved", "true")] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyCopyUsed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyCopyUsed.cs index f8538f0c5..92ad0b244 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyCopyUsed.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyCopyUsed.cs @@ -9,7 +9,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding // copyused - Forwarder.dll and Implementation.dll [SetupLinkerAction ("link", "test")] [SetupLinkerDefaultAction ("copyused")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadesKept.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinked.cs index 439e73d75..140d96077 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadesKept.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinked.cs @@ -6,9 +6,7 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding { // Actions: // link - This assembly, Forwarder.dll and Implementation.dll - // --keep-facades [SetupLinkerDefaultAction ("link")] - [KeepTypeForwarderOnlyAssemblies ("true")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] @@ -16,10 +14,9 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding [SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })] [SetupCompileAfter ("Forwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "Implementation.dll" })] - [KeptAssembly ("Forwarder.dll")] - [RemovedForwarder ("Forwarder.dll", "ImplementationLibrary")] + [RemovedAssembly ("Forwarder.dll")] [RemovedAssembly ("Implementation.dll")] - class UnusedForwarderWithAssemblyLinkedAndFacadesKept + class UnusedForwarderWithAssemblyLinked { static void Main () { diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadeCopy.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadeCopy.cs index c4105f7d3..64aa26ad6 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadeCopy.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UnusedForwarderWithAssemblyLinkedAndFacadeCopy.cs @@ -7,10 +7,8 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding // Actions: // link - This assembly, Implementation.dll // copy - Forwarder.dll - // --keep-facades [SetupLinkerDefaultAction ("link")] [SetupLinkerAction ("copy", "Forwarder")] - [KeepTypeForwarderOnlyAssemblies ("true")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary_3.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderReferencedFromCopyUsedAssembly.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderReferencedFromCopyUsedAssembly.cs index f8561ee7a..d68e5c8f4 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderReferencedFromCopyUsedAssembly.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderReferencedFromCopyUsedAssembly.cs @@ -7,7 +7,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding // Actions: // copyused - This assembly [SetupLinkerAction ("copyused", "test")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] [SetupCompileBefore ("ForwarderUnused.dll", new[] { "Dependencies/AnotherLibraryReferenceImplementation.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderWithAssemblyCopy.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderWithAssemblyCopy.cs index d21d34e02..465441df9 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderWithAssemblyCopy.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedAndUnusedForwarderWithAssemblyCopy.cs @@ -10,7 +10,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding [SetupLinkerDefaultAction ("copy")] [SetupLinkerAction ("link", "Unused")] [SetupLinkerAction ("link", "test")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderAndUnusedReference.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderAndUnusedReference.cs index aaead3bf5..a96657baf 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderAndUnusedReference.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderAndUnusedReference.cs @@ -7,7 +7,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding { // Actions: // link - This assembly, Forwarder.dll and Implementation.dll - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderInGenericIsDynamicallyAccessedWithAssemblyCopyUsed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderInGenericIsDynamicallyAccessedWithAssemblyCopyUsed.cs index 41169dc15..3406f85be 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderInGenericIsDynamicallyAccessedWithAssemblyCopyUsed.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderInGenericIsDynamicallyAccessedWithAssemblyCopyUsed.cs @@ -11,7 +11,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding { [SetupLinkerAction ("copyused", "Forwarder")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsDynamicallyAccessedWithAssemblyCopyUsed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsDynamicallyAccessedWithAssemblyCopyUsed.cs index 06d481f57..88e1a8519 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsDynamicallyAccessedWithAssemblyCopyUsed.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsDynamicallyAccessedWithAssemblyCopyUsed.cs @@ -10,7 +10,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding { [SetupLinkerAction ("copyused", "Forwarder")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsRemovedWhenLink.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsRemovedWhenLink.cs index 3db42a6ac..fe97b7e59 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsRemovedWhenLink.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderIsRemovedWhenLink.cs @@ -7,7 +7,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding { // Actions: // link - This assembly, Forwarder.dll and Implementation.dll - [KeepTypeForwarderOnlyAssemblies ("false")] [IgnoreDescriptors (false)] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopy.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopy.cs index 7067abe6a..9149662a8 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopy.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopy.cs @@ -9,7 +9,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding // copy - Forwarder.dll and Implementation.dll [SetupLinkerAction ("link", "test")] [SetupLinkerDefaultAction ("copy")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsed.cs index fb09a5b7c..d07226c14 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsed.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsed.cs @@ -9,7 +9,6 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding // copyused - Forwarder.dll and Implementation.dll [SetupLinkerAction ("link", "test")] [SetupLinkerDefaultAction ("copyused")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] @@ -19,6 +18,7 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding [RemovedAssembly ("Forwarder.dll")] [KeptMemberInAssembly ("Implementation.dll", typeof (ImplementationLibrary), "GetSomeValue()")] + [RemovedAssemblyReference ("test", "Forwarder")] class UsedForwarderWithAssemblyCopyUsed { static void Main () diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKept.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKept.cs deleted file mode 100644 index 6aa2e75bf..000000000 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKept.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Mono.Linker.Tests.Cases.Expectations.Assertions; -using Mono.Linker.Tests.Cases.Expectations.Metadata; -using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies; - -namespace Mono.Linker.Tests.Cases.TypeForwarding -{ - // Actions: - // link - This assembly - // copyused - Forwarder.dll and Implementation.dll - // --keep-facades - [SetupLinkerAction ("link", "test")] - [SetupLinkerDefaultAction ("copyused")] - [KeepTypeForwarderOnlyAssemblies ("true")] - - [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] - - // After compiling the test case we then replace the reference impl with implementation + type forwarder - [SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })] - [SetupCompileAfter ("Forwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "Implementation.dll" })] - - [KeptTypeInAssembly ("Forwarder.dll", typeof (ImplementationLibrary))] - [KeptMemberInAssembly ("Implementation.dll", typeof (ImplementationLibrary), "GetSomeValue()")] - [RemovedAssemblyReference ("test", "Forwarder")] - class UsedForwarderWithAssemblyCopyUsedAndFacadesKept - { - static void Main () - { - new ImplementationLibrary ().GetSomeValue (); - } - } -} diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndForwarderLibraryKept.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndForwarderLibraryKept.cs index e4e750c3d..789e047e4 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndForwarderLibraryKept.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndForwarderLibraryKept.cs @@ -7,7 +7,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies; namespace Mono.Linker.Tests.Cases.TypeForwarding { [SetupLinkerDefaultAction ("copyused")] - [KeepTypeForwarderOnlyAssemblies ("false")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKeptAndUnusedReference.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndUnusedReference.cs index c3c6e19ef..996fb2903 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndFacadesKeptAndUnusedReference.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndUnusedReference.cs @@ -7,10 +7,8 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding // Actions: // link - This assembly // copyused - Forwarder.dll, Implementation.dll, and UnusedImplementation.dll - // --keep-facades [SetupLinkerAction ("link", "test")] [SetupLinkerDefaultAction ("copyused")] - [KeepTypeForwarderOnlyAssemblies ("true")] [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationUsedAndUnusedLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] @@ -19,12 +17,11 @@ namespace Mono.Linker.Tests.Cases.TypeForwarding [SetupCompileAfter ("UnusedImplementation.dll", new[] { "Dependencies/UnusedImplementationLibrary.cs" })] [SetupCompileAfter ("Forwarder.dll", new[] { "Dependencies/ForwarderLibraryWithUnusedReference.cs" }, references: new[] { "Implementation.dll", "UnusedImplementation.dll" })] - [KeptTypeInAssembly ("Forwarder.dll", typeof (ImplementationLibrary))] - [KeptTypeInAssembly ("Forwarder.dll", typeof (UnusedImplementationLibrary))] + [RemovedAssembly ("Forwarder.dll")] [KeptMemberInAssembly ("Implementation.dll", typeof (ImplementationLibrary), "GetSomeValue()")] [RemovedAssemblyReference ("test", "Forwarder")] [RemovedAssembly ("UnusedImplementation.dll")] - class UsedForwarderWithAssemblyCopyUsedAndFacadesKeptAndUnusedReference + class UsedForwarderWithAssemblyCopyUsedAndUnusedReference { static void Main () { diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderInCopyUsedAssemblyIsDynamicallyAccessed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderInCopyUsedAssemblyIsDynamicallyAccessed.cs index c94e3d6c4..0bd837533 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderInCopyUsedAssemblyIsDynamicallyAccessed.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderInCopyUsedAssemblyIsDynamicallyAccessed.cs @@ -8,8 +8,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies; namespace Mono.Linker.Tests.Cases.TypeForwarding { - [KeepTypeForwarderOnlyAssemblies ("false")] - [SetupCompileBefore ("SecondForwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] [SetupCompileBefore ("FirstForwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "SecondForwarder.dll" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsDynamicallyAccessed.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsDynamicallyAccessed.cs index 1bb6ff188..c5ef41ef0 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsDynamicallyAccessed.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsDynamicallyAccessed.cs @@ -8,8 +8,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies; namespace Mono.Linker.Tests.Cases.TypeForwarding { - [KeepTypeForwarderOnlyAssemblies ("false")] - [SetupCompileBefore ("SecondForwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] [SetupCompileBefore ("FirstForwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "SecondForwarder.dll" })] diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsResolvedAndFacadeRemoved.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsResolvedAndFacadeRemoved.cs index c901b453f..d00a42e12 100644 --- a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsResolvedAndFacadeRemoved.cs +++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedTransitiveForwarderIsResolvedAndFacadeRemoved.cs @@ -8,8 +8,6 @@ using Mono.Linker.Tests.Cases.TypeForwarding.Dependencies; namespace Mono.Linker.Tests.Cases.TypeForwarding { - [KeepTypeForwarderOnlyAssemblies ("false")] - [SetupCompileBefore ("SecondForwarder.dll", new[] { "Dependencies/ReferenceImplementationLibrary.cs" }, defines: new[] { "INCLUDE_REFERENCE_IMPL" })] [SetupCompileBefore ("FirstForwarder.dll", new[] { "Dependencies/ForwarderLibrary.cs" }, references: new[] { "SecondForwarder.dll" })] [SetupCompileAfter ("Implementation.dll", new[] { "Dependencies/ImplementationLibrary.cs" })] diff --git a/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs b/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs index 6888c08f8..43dbcdd21 100644 --- a/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs +++ b/test/Mono.Linker.Tests/TestCasesRunner/LinkerArgumentBuilder.cs @@ -99,12 +99,6 @@ namespace Mono.Linker.Tests.TestCasesRunner Append (value); } - public virtual void AddKeepTypeForwarderOnlyAssemblies (string value) - { - if (bool.Parse (value)) - Append ("-t"); - } - public virtual void AddLinkSymbols (string value) { Append ("-b"); @@ -221,9 +215,6 @@ namespace Mono.Linker.Tests.TestCasesRunner AddIl8n (options.Il8n); #endif - if (!string.IsNullOrEmpty (options.KeepTypeForwarderOnlyAssemblies)) - AddKeepTypeForwarderOnlyAssemblies (options.KeepTypeForwarderOnlyAssemblies); - if (!string.IsNullOrEmpty (options.LinkSymbols)) AddLinkSymbols (options.LinkSymbols); diff --git a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs index 77bed13a4..67b29656e 100644 --- a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs +++ b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseLinkerOptions.cs @@ -15,7 +15,6 @@ namespace Mono.Linker.Tests.TestCasesRunner public bool IgnoreDescriptors; public bool IgnoreSubstitutions; public bool IgnoreLinkAttributes; - public string KeepTypeForwarderOnlyAssemblies; public string KeepDebugMembers; public string LinkSymbols; public bool SkipUnresolved; diff --git a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs index 0c788fa9e..a3290c4f6 100644 --- a/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs +++ b/test/Mono.Linker.Tests/TestCasesRunner/TestCaseMetadataProvider.cs @@ -27,7 +27,6 @@ namespace Mono.Linker.Tests.TestCasesRunner IgnoreDescriptors = GetOptionAttributeValue (nameof (IgnoreDescriptorsAttribute), true), IgnoreSubstitutions = GetOptionAttributeValue (nameof (IgnoreSubstitutionsAttribute), true), IgnoreLinkAttributes = GetOptionAttributeValue (nameof (IgnoreLinkAttributesAttribute), true), - KeepTypeForwarderOnlyAssemblies = GetOptionAttributeValue (nameof (KeepTypeForwarderOnlyAssembliesAttribute), string.Empty), KeepDebugMembers = GetOptionAttributeValue (nameof (SetupLinkerKeepDebugMembersAttribute), string.Empty), LinkSymbols = GetOptionAttributeValue (nameof (SetupLinkerLinkSymbolsAttribute), string.Empty), TrimMode = GetOptionAttributeValue<string> (nameof (SetupLinkerTrimModeAttribute), null), |