Skip to content

Commit a596935

Browse files
authored
ILLink : Test API expsure (#114567)
Re-expose `ReconstructedFullTypeName`. We rely on this in our test framework Expose `VerifyILOfOtherAssemblies`. This causes us problems for our tests that verify the old mono BCL. There's a goofy circular reference with Mono.Security.dll and System.dll which results in references to System.dll with two different PublicKeyTokens. Exposing this method let's us disable this asserting behavior for our old mono tests
1 parent 28bbd27 commit a596935

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/tools/illink/test/Mono.Linker.Tests/TestCases/TestCase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public TestCase (NPath sourceFile, NPath rootCasesDirectory, NPath originalTestC
2424

2525
// A little hacky, but good enough for name. No reason why namespace & type names
2626
// should not follow the directory structure
27-
reconstructedFullTypeName = $"{sourceFile.Parent.RelativeTo (rootCasesDirectory.Parent).ToString (SlashMode.Forward).Replace ('/', '.')}.{sourceFile.FileNameWithoutExtension}";
27+
ReconstructedFullTypeName = $"{sourceFile.Parent.RelativeTo (rootCasesDirectory.Parent).ToString (SlashMode.Forward).Replace ('/', '.')}.{sourceFile.FileNameWithoutExtension}";
2828

2929
var firstParentRelativeToRoot = SourceFile.RelativeTo (rootCasesDirectory).Elements.First ();
3030
TestSuiteDirectory = rootCasesDirectory.Combine (firstParentRelativeToRoot);
@@ -40,7 +40,7 @@ public TestCase (NPath sourceFile, NPath rootCasesDirectory, NPath originalTestC
4040

4141
public NPath OriginalTestCaseAssemblyPath { get; }
4242

43-
private string reconstructedFullTypeName;
43+
public string ReconstructedFullTypeName { get; }
4444

4545
public bool HasLinkXmlFile {
4646
get { return SourceFile.ChangeExtension ("xml").FileExists (); }
@@ -59,7 +59,7 @@ public NPath LinkXmlFile {
5959

6060
public TypeDefinition FindTypeDefinition (AssemblyDefinition caseAssemblyDefinition)
6161
{
62-
var typeDefinition = caseAssemblyDefinition.MainModule.GetType (reconstructedFullTypeName);
62+
var typeDefinition = caseAssemblyDefinition.MainModule.GetType (ReconstructedFullTypeName);
6363

6464
// For all of the Test Cases, the full type name we constructed from the directory structure will be correct and we can successfully find
6565
// the type from GetType.

src/tools/illink/test/Mono.Linker.Tests/TestCasesRunner/ResultChecker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ bool HasActiveSkipKeptItemsValidationAttribute (ICustomAttributeProvider provide
135135
}
136136
}
137137

138-
void VerifyILOfOtherAssemblies (TrimmedTestCaseResult linkResult)
138+
protected virtual void VerifyILOfOtherAssemblies (TrimmedTestCaseResult linkResult)
139139
{
140140
foreach (var linkedAssemblyPath in linkResult.Sandbox.OutputDirectory.Files ("*.dll")) {
141141
if (linkedAssemblyPath == linkResult.OutputAssemblyPath)

0 commit comments

Comments
 (0)