forked from dotnet/linker
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for mvid options and symbol files
The test for mdb + deterministic mvid and portable pdb + deterministic mvid had to be ignored because they encounter jbevain/cecil#583
- Loading branch information
Showing
9 changed files
with
227 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ests.Cases/Symbols/ReferenceWithEmbeddedPdbAndSymbolLinkingEnabledAndDeterministicMvid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
using Mono.Linker.Tests.Cases.Expectations.Metadata; | ||
using Mono.Linker.Tests.Cases.Symbols.Dependencies; | ||
|
||
namespace Mono.Linker.Tests.Cases.Symbols { | ||
[SetupCompileBefore ("LibraryWithEmbeddedPdbSymbols.dll", new[] { "Dependencies/LibraryWithEmbeddedPdbSymbols.cs" }, additionalArguments: "/debug:embedded", compilerToUse: "csc")] | ||
[SetupLinkerLinkSymbols ("true")] | ||
[SetupLinkerArgument ("--deterministic")] | ||
|
||
[KeptSymbols ("LibraryWithEmbeddedPdbSymbols.dll")] | ||
|
||
[KeptMemberInAssembly ("LibraryWithEmbeddedPdbSymbols.dll", typeof (LibraryWithEmbeddedPdbSymbols), "SomeMethod()")] | ||
[RemovedMemberInAssembly ("LibraryWithEmbeddedPdbSymbols.dll", typeof (LibraryWithEmbeddedPdbSymbols), "NotUsed()")] | ||
public class ReferenceWithEmbeddedPdbAndSymbolLinkingEnabledAndDeterministicMvid { | ||
static void Main () | ||
{ | ||
LibraryWithEmbeddedPdbSymbols.SomeMethod (); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...o.Linker.Tests.Cases/Symbols/ReferenceWithEmbeddedPdbAndSymbolLinkingEnabledAndNewMvid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
using Mono.Linker.Tests.Cases.Expectations.Metadata; | ||
using Mono.Linker.Tests.Cases.Symbols.Dependencies; | ||
|
||
namespace Mono.Linker.Tests.Cases.Symbols { | ||
[SetupCompileBefore ("LibraryWithEmbeddedPdbSymbols.dll", new[] { "Dependencies/LibraryWithEmbeddedPdbSymbols.cs" }, additionalArguments: "/debug:embedded", compilerToUse: "csc")] | ||
[SetupLinkerLinkSymbols ("true")] | ||
[SetupLinkerArgument ("--deterministic")] | ||
|
||
[KeptSymbols ("LibraryWithEmbeddedPdbSymbols.dll")] | ||
|
||
[KeptMemberInAssembly ("LibraryWithEmbeddedPdbSymbols.dll", typeof (LibraryWithEmbeddedPdbSymbols), "SomeMethod()")] | ||
[RemovedMemberInAssembly ("LibraryWithEmbeddedPdbSymbols.dll", typeof (LibraryWithEmbeddedPdbSymbols), "NotUsed()")] | ||
public class ReferenceWithEmbeddedPdbAndSymbolLinkingEnabledAndNewMvid { | ||
static void Main () | ||
{ | ||
LibraryWithEmbeddedPdbSymbols.SomeMethod (); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...Linker.Tests.Cases/Symbols/ReferenceWithMdbAndSymbolLinkingEnabledAndDeterministicMvid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
using Mono.Linker.Tests.Cases.Expectations.Metadata; | ||
using Mono.Linker.Tests.Cases.Symbols.Dependencies; | ||
|
||
namespace Mono.Linker.Tests.Cases.Symbols { | ||
[IgnoreTestCase ("Requires cecil updated with fix for https://github.com/jbevain/cecil/issues/583")] | ||
[Reference ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll")] | ||
[ReferenceDependency ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll.mdb")] | ||
[SetupLinkerLinkSymbols ("true")] | ||
[SetupLinkerArgument ("--deterministic")] | ||
|
||
[KeptSymbols ("LibraryWithMdb.dll")] | ||
|
||
[KeptMemberInAssembly ("LibraryWithMdb.dll", typeof (LibraryWithMdb), "SomeMethod()")] | ||
[RemovedMemberInAssembly ("LibraryWithMdb.dll", typeof (LibraryWithMdb), "NotUsed()")] | ||
public class ReferenceWithMdbAndSymbolLinkingEnabledAndDeterministicMvid { | ||
static void Main () | ||
{ | ||
// Use some stuff so that we can verify that the linker output correct results | ||
SomeMethod (); | ||
|
||
LibraryWithMdb.SomeMethod (); | ||
} | ||
|
||
[Kept] | ||
static void SomeMethod () | ||
{ | ||
} | ||
|
||
static void NotUsed () | ||
{ | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithMdbAndSymbolLinkingEnabledAndNewMvid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
using Mono.Linker.Tests.Cases.Expectations.Metadata; | ||
using Mono.Linker.Tests.Cases.Symbols.Dependencies; | ||
|
||
namespace Mono.Linker.Tests.Cases.Symbols { | ||
[Reference ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll")] | ||
[ReferenceDependency ("Dependencies/LibraryWithMdb/LibraryWithMdb.dll.mdb")] | ||
[SetupLinkerLinkSymbols ("true")] | ||
[SetupLinkerArgument ("--new-mvid", "true")] | ||
|
||
[KeptSymbols ("LibraryWithMdb.dll")] | ||
|
||
[KeptMemberInAssembly ("LibraryWithMdb.dll", typeof (LibraryWithMdb), "SomeMethod()")] | ||
[RemovedMemberInAssembly ("LibraryWithMdb.dll", typeof (LibraryWithMdb), "NotUsed()")] | ||
public class ReferenceWithMdbAndSymbolLinkingEnabledAndNewMvid { | ||
static void Main () | ||
{ | ||
// Use some stuff so that we can verify that the linker output correct results | ||
SomeMethod (); | ||
|
||
LibraryWithMdb.SomeMethod (); | ||
} | ||
|
||
[Kept] | ||
static void SomeMethod () | ||
{ | ||
} | ||
|
||
static void NotUsed () | ||
{ | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabledAndDeterministicMvid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
using Mono.Linker.Tests.Cases.Expectations.Metadata; | ||
using Mono.Linker.Tests.Cases.Symbols.Dependencies; | ||
|
||
namespace Mono.Linker.Tests.Cases.Symbols { | ||
[Reference ("Dependencies/LibraryWithPdb/LibraryWithPdb.dll")] | ||
[ReferenceDependency ("Dependencies/LibraryWithPdb/LibraryWithPdb.pdb")] | ||
[SetupLinkerLinkSymbols( "true")] | ||
[SetupLinkerArgument ("--deterministic")] | ||
|
||
#if WIN32 | ||
[KeptSymbols ("LibraryWithPdb.dll")] | ||
#else | ||
[RemovedSymbols ("LibraryWithPdb.dll")] | ||
#endif | ||
[KeptMemberInAssembly ("LibraryWithPdb.dll", typeof (LibraryWithPdb), "SomeMethod()")] | ||
[RemovedMemberInAssembly ("LibraryWithPdb.dll", typeof (LibraryWithPdb), "NotUsed()")] | ||
public class ReferenceWithPdbAndSymbolLinkingEnabledAndDeterministicMvid { | ||
static void Main () | ||
{ | ||
// Use some stuff so that we can verify that the linker output correct results | ||
SomeMethod(); | ||
LibraryWithPdb.SomeMethod (); | ||
} | ||
|
||
[Kept] | ||
static void SomeMethod () | ||
{ | ||
} | ||
|
||
static void NotUsed () | ||
{ | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
test/Mono.Linker.Tests.Cases/Symbols/ReferenceWithPdbAndSymbolLinkingEnabledAndNewMvid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
using Mono.Linker.Tests.Cases.Expectations.Metadata; | ||
using Mono.Linker.Tests.Cases.Symbols.Dependencies; | ||
|
||
namespace Mono.Linker.Tests.Cases.Symbols { | ||
[Reference ("Dependencies/LibraryWithPdb/LibraryWithPdb.dll")] | ||
[ReferenceDependency ("Dependencies/LibraryWithPdb/LibraryWithPdb.pdb")] | ||
[SetupLinkerLinkSymbols( "true")] | ||
[SetupLinkerArgument ("--new-mvid", "true")] | ||
|
||
#if WIN32 | ||
[KeptSymbols ("LibraryWithPdb.dll")] | ||
#else | ||
[RemovedSymbols ("LibraryWithPdb.dll")] | ||
#endif | ||
[KeptMemberInAssembly ("LibraryWithPdb.dll", typeof (LibraryWithPdb), "SomeMethod()")] | ||
[RemovedMemberInAssembly ("LibraryWithPdb.dll", typeof (LibraryWithPdb), "NotUsed()")] | ||
public class ReferenceWithPdbAndSymbolLinkingEnabledAndNewMvid { | ||
static void Main () | ||
{ | ||
// Use some stuff so that we can verify that the linker output correct results | ||
SomeMethod(); | ||
LibraryWithPdb.SomeMethod (); | ||
} | ||
|
||
[Kept] | ||
static void SomeMethod () | ||
{ | ||
} | ||
|
||
static void NotUsed () | ||
{ | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...ests.Cases/Symbols/ReferenceWithPortablePdbAndSymbolLinkingEnabledAndDeterministicMvid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
using Mono.Linker.Tests.Cases.Expectations.Metadata; | ||
using Mono.Linker.Tests.Cases.Symbols.Dependencies; | ||
|
||
namespace Mono.Linker.Tests.Cases.Symbols { | ||
[IgnoreTestCase ("Requires cecil updated with fix for https://github.com/jbevain/cecil/issues/583")] | ||
[SetupCompileBefore ("LibraryWithPortablePdbSymbols.dll", new[] { "Dependencies/LibraryWithPortablePdbSymbols.cs" }, additionalArguments: "/debug:portable", compilerToUse: "csc")] | ||
[SetupLinkerLinkSymbols ("true")] | ||
[SetupLinkerArgument ("--deterministic")] | ||
|
||
[KeptSymbols ("LibraryWithPortablePdbSymbols.dll")] | ||
|
||
[KeptMemberInAssembly ("LibraryWithPortablePdbSymbols.dll", typeof (LibraryWithPortablePdbSymbols), "SomeMethod()")] | ||
[RemovedMemberInAssembly ("LibraryWithPortablePdbSymbols.dll", typeof (LibraryWithPortablePdbSymbols), "NotUsed()")] | ||
public class ReferenceWithPortablePdbAndSymbolLinkingEnabledAndDeterministicMvid { | ||
static void Main() | ||
{ | ||
LibraryWithPortablePdbSymbols.SomeMethod (); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...o.Linker.Tests.Cases/Symbols/ReferenceWithPortablePdbAndSymbolLinkingEnabledAndNewMvid.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
using Mono.Linker.Tests.Cases.Expectations.Metadata; | ||
using Mono.Linker.Tests.Cases.Symbols.Dependencies; | ||
|
||
namespace Mono.Linker.Tests.Cases.Symbols { | ||
[SetupCompileBefore ("LibraryWithPortablePdbSymbols.dll", new[] { "Dependencies/LibraryWithPortablePdbSymbols.cs" }, additionalArguments: "/debug:portable", compilerToUse: "csc")] | ||
[SetupLinkerLinkSymbols ("true")] | ||
[SetupLinkerArgument ("--new-mvid", "true")] | ||
|
||
[KeptSymbols ("LibraryWithPortablePdbSymbols.dll")] | ||
|
||
[KeptMemberInAssembly ("LibraryWithPortablePdbSymbols.dll", typeof (LibraryWithPortablePdbSymbols), "SomeMethod()")] | ||
[RemovedMemberInAssembly ("LibraryWithPortablePdbSymbols.dll", typeof (LibraryWithPortablePdbSymbols), "NotUsed()")] | ||
public class ReferenceWithPortablePdbAndSymbolLinkingEnabledAndNewMvid { | ||
static void Main() | ||
{ | ||
LibraryWithPortablePdbSymbols.SomeMethod (); | ||
} | ||
} | ||
} |