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:
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndUnusedReference.cs')
-rw-r--r--test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndUnusedReference.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndUnusedReference.cs b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndUnusedReference.cs
new file mode 100644
index 000000000..996fb2903
--- /dev/null
+++ b/test/Mono.Linker.Tests.Cases/TypeForwarding/UsedForwarderWithAssemblyCopyUsedAndUnusedReference.cs
@@ -0,0 +1,31 @@
+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, Implementation.dll, and UnusedImplementation.dll
+ [SetupLinkerAction ("link", "test")]
+ [SetupLinkerDefaultAction ("copyused")]
+
+ [SetupCompileBefore ("Forwarder.dll", new[] { "Dependencies/ReferenceImplementationUsedAndUnusedLibrary.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 ("UnusedImplementation.dll", new[] { "Dependencies/UnusedImplementationLibrary.cs" })]
+ [SetupCompileAfter ("Forwarder.dll", new[] { "Dependencies/ForwarderLibraryWithUnusedReference.cs" }, references: new[] { "Implementation.dll", "UnusedImplementation.dll" })]
+
+ [RemovedAssembly ("Forwarder.dll")]
+ [KeptMemberInAssembly ("Implementation.dll", typeof (ImplementationLibrary), "GetSomeValue()")]
+ [RemovedAssemblyReference ("test", "Forwarder")]
+ [RemovedAssembly ("UnusedImplementation.dll")]
+ class UsedForwarderWithAssemblyCopyUsedAndUnusedReference
+ {
+ static void Main ()
+ {
+ new ImplementationLibrary ().GetSomeValue ();
+ }
+ }
+}