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
path: root/test
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2021-10-04 16:49:57 +0300
committerGitHub <noreply@github.com>2021-10-04 16:49:57 +0300
commita7c82c86aac1535296d79e67f7165ea12ae53867 (patch)
tree48560e18c045cc27ac5d6ae094c69bdaa576f7fb /test
parent883ec5c041787300fff4d694f44c22166a1983cb (diff)
Revert "Add COMAnalyzer" (#2305)
Diffstat (limited to 'test')
-rw-r--r--test/ILLink.RoslynAnalyzer.Tests/LinkerTestCases.cs7
-rw-r--r--test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs12
-rw-r--r--test/Mono.Linker.Tests.Cases/Interop/PInvoke/Warnings/ComPInvokeWarning.cs22
3 files changed, 3 insertions, 38 deletions
diff --git a/test/ILLink.RoslynAnalyzer.Tests/LinkerTestCases.cs b/test/ILLink.RoslynAnalyzer.Tests/LinkerTestCases.cs
index 436f2554c..4528116d5 100644
--- a/test/ILLink.RoslynAnalyzer.Tests/LinkerTestCases.cs
+++ b/test/ILLink.RoslynAnalyzer.Tests/LinkerTestCases.cs
@@ -28,12 +28,5 @@ namespace ILLink.RoslynAnalyzer.Tests
RunTest<RequiresUnreferencedCodeAnalyzer> (m, attrs, UseMSBuildProperties (MSBuildPropertyOptionNames.EnableTrimAnalyzer));
}
-
- [Theory]
- [MemberData (nameof (TestCaseUtils.GetTestData), parameters: nameof (Interop))]
- public void Interop (MethodDeclarationSyntax m, List<AttributeSyntax> attrs)
- {
- RunTest<COMAnalyzer> (m, attrs, UseMSBuildProperties (MSBuildPropertyOptionNames.EnableTrimAnalyzer));
- }
}
}
diff --git a/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs b/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs
index d23e468e3..fadac2914 100644
--- a/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs
+++ b/test/ILLink.RoslynAnalyzer.Tests/TestCaseUtils.cs
@@ -19,8 +19,6 @@ namespace ILLink.RoslynAnalyzer.Tests
{
public abstract class TestCaseUtils
{
- private static readonly string MonoLinkerTestsCases = "Mono.Linker.Tests.Cases";
-
public static readonly ReferenceAssemblies Net6PreviewAssemblies =
new ReferenceAssemblies (
"net6.0",
@@ -89,16 +87,12 @@ namespace ILLink.RoslynAnalyzer.Tests
var builder = ImmutableDictionary.CreateBuilder<string, List<string>> ();
foreach (var file in GetTestFiles ()) {
- var directory = Path.GetDirectoryName (file);
- while (Path.GetFileName (Path.GetDirectoryName (directory)) != MonoLinkerTestsCases)
- directory = Path.GetDirectoryName (directory);
-
- var parentDirectory = Path.GetFileName (directory);
- if (builder.TryGetValue (parentDirectory!, out var sources)) {
+ var dirName = Path.GetFileName (Path.GetDirectoryName (file))!;
+ if (builder.TryGetValue (dirName, out var sources)) {
sources.Add (file);
} else {
sources = new List<string> () { file };
- builder[parentDirectory!] = sources;
+ builder[dirName] = sources;
}
}
diff --git a/test/Mono.Linker.Tests.Cases/Interop/PInvoke/Warnings/ComPInvokeWarning.cs b/test/Mono.Linker.Tests.Cases/Interop/PInvoke/Warnings/ComPInvokeWarning.cs
index d64847908..720ad738b 100644
--- a/test/Mono.Linker.Tests.Cases/Interop/PInvoke/Warnings/ComPInvokeWarning.cs
+++ b/test/Mono.Linker.Tests.Cases/Interop/PInvoke/Warnings/ComPInvokeWarning.cs
@@ -15,7 +15,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
[UnconditionalSuppressMessage ("trim", "IL2026")]
static void Main ()
{
- Call_SomeMethodReturningAutoLayoutClass ();
Call_SomeMethodTakingInterface ();
Call_SomeMethodTakingObject ();
Call_SomeMethodTakingArray ();
@@ -39,7 +38,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
SomeMethodTakingInterface (null);
}
-
[DllImport ("Foo")]
static extern void SomeMethodTakingInterface (IFoo foo);
@@ -48,7 +46,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
SomeMethodTakingObject (null);
}
-
[DllImport ("Foo")]
static extern void SomeMethodTakingObject ([MarshalAs (UnmanagedType.IUnknown)] object obj);
@@ -57,7 +54,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
SomeMethodTakingArray (null);
}
-
[DllImport ("Foo")]
static extern void SomeMethodTakingArray (Array array);
@@ -65,7 +61,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
SomeMethodTakingStringBuilder (null);
}
-
[DllImport ("Foo")]
static extern void SomeMethodTakingStringBuilder (StringBuilder str);
@@ -73,7 +68,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
SomeMethodTakingCriticalHandle (null);
}
-
[DllImport ("Foo")]
static extern void SomeMethodTakingCriticalHandle (MyCriticalHandle handle);
@@ -82,7 +76,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
SomeMethodTakingSafeHandle (null);
}
-
[DllImport ("Foo")]
static extern void SomeMethodTakingSafeHandle (TestSafeHandle handle);
@@ -90,7 +83,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
SomeMethodTakingExplicitLayout (null);
}
-
[DllImport ("Foo")]
static extern void SomeMethodTakingExplicitLayout (ExplicitLayout _class);
@@ -98,7 +90,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
SomeMethodTakingSequentialLayout (null);
}
-
[DllImport ("Foo")]
static extern void SomeMethodTakingSequentialLayout (SequentialLayout _class);
@@ -107,24 +98,14 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
SomeMethodTakingAutoLayout (null);
}
-
[DllImport ("Foo")]
static extern void SomeMethodTakingAutoLayout (AutoLayout _class);
- [ExpectedWarning ("IL2050")]
- static void Call_SomeMethodReturningAutoLayoutClass ()
- {
- SomeMethodReturningAutoLayout ();
- }
-
- [DllImport ("Foo")]
- static extern AutoLayout SomeMethodReturningAutoLayout ();
static void Call_SomeMethodTakingString ()
{
SomeMethodTakingString (null);
}
-
[DllImport ("Foo")]
static extern void SomeMethodTakingString (String str);
@@ -133,7 +114,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
GetInterface ();
}
-
[DllImport ("Foo")]
static extern IFoo GetInterface ();
@@ -142,7 +122,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
CanSuppressWarningOnParameter (null);
}
-
[DllImport ("Foo")]
static extern void CanSuppressWarningOnParameter ([MarshalAs (UnmanagedType.IUnknown)] object obj);
@@ -151,7 +130,6 @@ namespace Mono.Linker.Tests.Cases.Interop.PInvoke.Warnings
{
CanSuppressWarningOnReturnType ();
}
-
[DllImport ("Foo")]
static extern IFoo CanSuppressWarningOnReturnType ();