From 26b90d39317dea97b31bab99301738f6b9296d67 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Strehovsk=C3=BD?= Date: Sat, 27 Aug 2022 14:57:45 +0900 Subject: [PATCH] Pass over interop tests with NativeAOT (#74627) * Mark tests as NativeAotIncompatible in project file instead of disabling in issues.targets so that we don't even build them. * Tweak for COM disabled * Block some tests on a new issue --- src/tests/Directory.Build.targets | 1 + src/tests/Interop/COM/Activator/Activator.csproj | 2 +- .../Activator/ActivatorBuiltInComDisabled.csproj | 2 +- .../ComWrappers/WeakReference/WeakReferenceTest.cs | 3 ++- src/tests/Interop/COM/Directory.Build.targets | 2 ++ .../COM/ExtensionPoints/ExtensionPoints.csproj | 1 + .../COM/NativeClients/Directory.Build.props | 1 + src/tests/Interop/COM/Reflection/Reflection.csproj | 1 + .../Interop/ExecInDefAppDom/ExecInDefAppDom.csproj | 1 + src/tests/Interop/ICastable/Castable.csproj | 1 + .../CopyConstructorMarshaler.csproj | 7 ------ src/tests/Interop/IJW/Directory.Build.props | 16 +++++++++++++ .../FixupCallsHostWhenLoaded.csproj | 7 ------ .../ManagedCallingNative.csproj | 7 ------ .../NativeCallingManaged.csproj | 7 ------ .../IJW/NativeVarargs/NativeVarargsTest.csproj | 7 ------ .../MarshalAPI/IUnknown/IUnknownTest.csproj | 1 + .../MarshalAPI/IUnknown/IUnknownTestInALC.csproj | 1 + .../CustomMarshalers/CustomMarshalersTest.csproj | 1 + .../AssemblyTrue/AssemblyTrueTest.csproj | 1 + .../AssemblyWithoutComVisibleTest.csproj | 1 + .../Default/DefaultTest.csproj | 1 + .../Default/DefaultTestInALC.csproj | 1 + src/tests/issues.targets | 26 ++++++---------------- 24 files changed, 42 insertions(+), 57 deletions(-) create mode 100644 src/tests/Interop/IJW/Directory.Build.props diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index 7008a3c..a0b4cf6 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -95,6 +95,7 @@ <_WillCLRTestProjectBuild Condition="'$(BuildAllProjects)' == 'true' And '$(CLRTestPriority)' <= '$(CLRTestPriorityToBuild)'">true <_WillCLRTestProjectBuild Condition="'$(CLRTestBuildAllTargets)' != 'allTargets' And '$(CLRTestTargetUnsupported)' == 'true'">false <_WillCLRTestProjectBuild Condition="'$(DisableProjectBuild)' == 'true'">false + <_WillCLRTestProjectBuild Condition="'$(NativeAotIncompatible)' == 'true' and '$(TestBuildMode)' == 'nativeaot'">false <_CopyNativeProjectBinaries Condition="'$(__CopyNativeTestBinaries)' != '1'">$(__CopyNativeProjectsAfterCombinedTestBuild) diff --git a/src/tests/Interop/COM/Activator/Activator.csproj b/src/tests/Interop/COM/Activator/Activator.csproj index 6090e01d..ec16d71 100644 --- a/src/tests/Interop/COM/Activator/Activator.csproj +++ b/src/tests/Interop/COM/Activator/Activator.csproj @@ -4,8 +4,8 @@ true true - true true + true diff --git a/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj b/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj index 5414a40..f0c7095 100644 --- a/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj +++ b/src/tests/Interop/COM/Activator/ActivatorBuiltInComDisabled.csproj @@ -4,8 +4,8 @@ true true - true true + true diff --git a/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceTest.cs b/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceTest.cs index 516a86a..e10a8c4 100644 --- a/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceTest.cs +++ b/src/tests/Interop/COM/ComWrappers/WeakReference/WeakReferenceTest.cs @@ -8,6 +8,7 @@ namespace ComWrappersTests using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; + using TestLibrary; using Xunit; static class WeakReferenceNative @@ -273,7 +274,7 @@ namespace ComWrappersTests { try { - if (OperatingSystem.IsWindows()) + if (PlatformDetection.IsBuiltInComEnabled) { ValidateNonComWrappers(); diff --git a/src/tests/Interop/COM/Directory.Build.targets b/src/tests/Interop/COM/Directory.Build.targets index 818c95e..1761a1e 100644 --- a/src/tests/Interop/COM/Directory.Build.targets +++ b/src/tests/Interop/COM/Directory.Build.targets @@ -6,6 +6,8 @@ true true + + true diff --git a/src/tests/Interop/COM/ExtensionPoints/ExtensionPoints.csproj b/src/tests/Interop/COM/ExtensionPoints/ExtensionPoints.csproj index 7057728..017a24c 100644 --- a/src/tests/Interop/COM/ExtensionPoints/ExtensionPoints.csproj +++ b/src/tests/Interop/COM/ExtensionPoints/ExtensionPoints.csproj @@ -2,6 +2,7 @@ true true + true diff --git a/src/tests/Interop/COM/NativeClients/Directory.Build.props b/src/tests/Interop/COM/NativeClients/Directory.Build.props index b1f9b92..6d234ec 100644 --- a/src/tests/Interop/COM/NativeClients/Directory.Build.props +++ b/src/tests/Interop/COM/NativeClients/Directory.Build.props @@ -8,6 +8,7 @@ true false + true diff --git a/src/tests/Interop/COM/Reflection/Reflection.csproj b/src/tests/Interop/COM/Reflection/Reflection.csproj index 157be61..6009456 100644 --- a/src/tests/Interop/COM/Reflection/Reflection.csproj +++ b/src/tests/Interop/COM/Reflection/Reflection.csproj @@ -1,6 +1,7 @@ Exe + true diff --git a/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj b/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj index 7ac064f..72c4b79 100644 --- a/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj +++ b/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj @@ -2,6 +2,7 @@ Exe true + true diff --git a/src/tests/Interop/ICastable/Castable.csproj b/src/tests/Interop/ICastable/Castable.csproj index 76fc602..ff9fd9f 100644 --- a/src/tests/Interop/ICastable/Castable.csproj +++ b/src/tests/Interop/ICastable/Castable.csproj @@ -1,6 +1,7 @@ true + true diff --git a/src/tests/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler.csproj b/src/tests/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler.csproj index 166dcb0..11ef9ab 100644 --- a/src/tests/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler.csproj +++ b/src/tests/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler.csproj @@ -1,13 +1,6 @@ Exe - - - true - - true - - true true diff --git a/src/tests/Interop/IJW/Directory.Build.props b/src/tests/Interop/IJW/Directory.Build.props new file mode 100644 index 0000000..6faba48 --- /dev/null +++ b/src/tests/Interop/IJW/Directory.Build.props @@ -0,0 +1,16 @@ + + + + + + + true + + true + + true + + true + + + diff --git a/src/tests/Interop/IJW/FixupCallsHostWhenLoaded/FixupCallsHostWhenLoaded.csproj b/src/tests/Interop/IJW/FixupCallsHostWhenLoaded/FixupCallsHostWhenLoaded.csproj index daf75fd..f6c3f25 100644 --- a/src/tests/Interop/IJW/FixupCallsHostWhenLoaded/FixupCallsHostWhenLoaded.csproj +++ b/src/tests/Interop/IJW/FixupCallsHostWhenLoaded/FixupCallsHostWhenLoaded.csproj @@ -1,13 +1,6 @@ Exe - - - true - - true - - true true diff --git a/src/tests/Interop/IJW/ManagedCallingNative/ManagedCallingNative.csproj b/src/tests/Interop/IJW/ManagedCallingNative/ManagedCallingNative.csproj index 94bbd19..015c3ba 100644 --- a/src/tests/Interop/IJW/ManagedCallingNative/ManagedCallingNative.csproj +++ b/src/tests/Interop/IJW/ManagedCallingNative/ManagedCallingNative.csproj @@ -1,13 +1,6 @@ Exe - - - true - - true - - true true diff --git a/src/tests/Interop/IJW/NativeCallingManaged/NativeCallingManaged.csproj b/src/tests/Interop/IJW/NativeCallingManaged/NativeCallingManaged.csproj index 2ed786c..c745902 100644 --- a/src/tests/Interop/IJW/NativeCallingManaged/NativeCallingManaged.csproj +++ b/src/tests/Interop/IJW/NativeCallingManaged/NativeCallingManaged.csproj @@ -1,13 +1,6 @@ Exe - - - true - - true - - true true diff --git a/src/tests/Interop/IJW/NativeVarargs/NativeVarargsTest.csproj b/src/tests/Interop/IJW/NativeVarargs/NativeVarargsTest.csproj index 6a18b97..700a662 100644 --- a/src/tests/Interop/IJW/NativeVarargs/NativeVarargsTest.csproj +++ b/src/tests/Interop/IJW/NativeVarargs/NativeVarargsTest.csproj @@ -1,15 +1,8 @@ Exe - - - true - - true true - - true true diff --git a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.csproj b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.csproj index bd59239..55ce23f 100644 --- a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.csproj +++ b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTest.csproj @@ -3,6 +3,7 @@ Exe true + true diff --git a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTestInALC.csproj b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTestInALC.csproj index 5a49cf6..8281273 100644 --- a/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTestInALC.csproj +++ b/src/tests/Interop/MarshalAPI/IUnknown/IUnknownTestInALC.csproj @@ -3,6 +3,7 @@ Exe true + true diff --git a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj index 59abc7f..c6f5007 100644 --- a/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj +++ b/src/tests/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest.csproj @@ -4,6 +4,7 @@ true true + true diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj index b51d78e..104d971 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.csproj @@ -3,6 +3,7 @@ Exe true + true diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj index d912e20..28772c8 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.csproj @@ -3,6 +3,7 @@ Exe true + true diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj index 1115d67..da796a1 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.csproj @@ -3,6 +3,7 @@ Exe true + true diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTestInALC.csproj b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTestInALC.csproj index 880c08c..32e2650 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTestInALC.csproj +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTestInALC.csproj @@ -3,6 +3,7 @@ Exe true + true diff --git a/src/tests/issues.targets b/src/tests/issues.targets index 8ca190f..9304527 100644 --- a/src/tests/issues.targets +++ b/src/tests/issues.targets @@ -943,9 +943,6 @@ Test expects being run with corerun - - ICastable is CoreCLR specific - Just-in-time compilation test @@ -1003,27 +1000,24 @@ https://github.com/dotnet/runtimelab/issues/155: SAFEARRAY - - https://github.com/dotnet/runtimelab/issues/155: COM + + https://github.com/dotnet/runtime/issues/74620 - - Specific to CoreCLR + + https://github.com/dotnet/runtime/issues/74620 + + + https://github.com/dotnet/runtime/issues/74620 https://github.com/dotnet/runtimelab/issues/155: AssemblyLoadContext.LoadFromAssemblyPath - - https://github.com/dotnet/runtimelab/issues/155: C++/CLI - https://github.com/dotnet/runtimelab/issues/163 https://github.com/dotnet/runtimelab/issues/164 - - https://github.com/dotnet/runtimelab/issues/155: COM - https://github.com/dotnet/runtimelab/issues/165 @@ -1057,9 +1051,6 @@ https://github.com/dotnet/runtimelab/issues/173 - - Specific to CoreCLR: Built-in COM Interop - https://github.com/dotnet/runtimelab/issues/175 @@ -1075,9 +1066,6 @@ https://github.com/dotnet/runtimelab/issues/155: C++/CLI - - https://github.com/dotnet/runtimelab/issues/155: COM - https://github.com/dotnet/runtimelab/issues/168 -- 2.7.4