From fd64e64a207a99b55e90907d3fd31fff6c43d3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Rylek?= Date: Thu, 11 Nov 2021 01:02:28 +0100 Subject: [PATCH] Explicitly mark tests with CLRTestKind=SharedLibrary (#61235) Previously the Directory.Build.targets script used to automatically infer that OutputType=Library without a CLRTestKind implies SharedLibrary. This is however hard to consolidate with the planned test merging - as the SDK script set OutputType=Library by default, we need the combination Library+(implicit)BuildAndRun to indicate the "new-style" [Fact]-based tests. For this reason I propose to remove this automatic inference and manually fix the handful of tests that are missing an explicit CLRTestKind=SharedLibrary property. In light of this description we can theoretically remove the OutputType=Library specification from all test projects but even if we decide to do that, I believe it will be easier to do that as a separate mechanical change, not as part of this relatively small change that has a different purpose. Additionally in the one case of the GitHub_22583 regression test, I removed the explicit setting of GenerateRunScript=false because that's the default. Fix OutputType=exe in OpenDelegate.csproj I believe this was a pre-existing bug - previously, with the special clause regarding SharedLibrary, the test just got silently skipped because it was considered to be a shared library. Thanks Tomas --- src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.csproj | 1 + src/tests/Directory.Build.targets | 1 - .../ApplyUpdateReferencedAssembly.csproj | 1 + src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj | 1 + src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj | 1 + src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj | 1 + .../Interop/COM/Activator/Servers/AssemblyContracts.csproj | 1 + .../Interop/COM/NETServer/NETServer.DefaultInterfaces.ilproj | 1 + src/tests/Interop/COM/NETServer/NETServer.csproj | 1 + .../ICustomMarshaler/ConflictingNames/CustomMarshaler.csproj | 1 + .../ICustomMarshaler/ConflictingNames/CustomMarshaler2.csproj | 1 + .../NativeLibrary/AssemblyLoadContext/TestAsm/TestAsm.csproj | 1 + .../Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.ilproj | 1 + .../ManagedDll1/ManagedDll1.csproj | 1 + .../ManagedDll2/ManagedDll2.csproj | 1 + .../SuppressGCTransition/SuppressGCTransitionUtil.ilproj | 1 + src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj | 1 + src/tests/Interop/UnmanagedCallersOnly/InvalidCSharp.ilproj | 1 + src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj | 2 +- src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj | 2 +- src/tests/Regressions/coreclr/22021/provider.ilproj | 1 + src/tests/baseservices/callconvs/CallFunctionPointers.ilproj | 1 + .../RuntimeWrappedException/StringThrower.ilproj | 1 + .../baseservices/compilerservices/modulector/moduleCctor.ilproj | 1 + .../baseservices/typeequivalence/contracts/TypeContracts.csproj | 1 + src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj | 1 + src/tests/ilverify/ILTests/ILTests.targets | 1 + src/tests/profiler/unittest/unloadlibrary.csproj | 1 + .../DefaultInterfaceMethods/GetInterfaceMapProvider.ilproj | 1 + .../reflection/DefaultInterfaceMethods/InvokeProvider.ilproj | 1 + src/tests/reflection/RefEmit/Dependency.csproj | 1 + src/tests/reflection/StaticInterfaceMembers/provider.ilproj | 1 + 32 files changed, 31 insertions(+), 3 deletions(-) diff --git a/src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.csproj b/src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.csproj index 249c25e8d7634d..73107e770d30f6 100644 --- a/src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.csproj +++ b/src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.csproj @@ -1,5 +1,6 @@ + exe true 1 diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index 94098734f6fcfd..2866110fb4c360 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -11,7 +11,6 @@ - SharedLibrary BuildAndRun 0 diff --git a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj index b32d3ba167d612..d7efb6b3e39b57 100644 --- a/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj +++ b/src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj @@ -3,6 +3,7 @@ true deltascript.json library + SharedLibrary false true diff --git a/src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj b/src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj index f45dd134b5aba6..e89acacf3bf393 100644 --- a/src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj +++ b/src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj b/src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj index 06f18447601fc7..e167fbfa6fb068 100644 --- a/src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj +++ b/src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj b/src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj index 98381754613dd1..77484f4e95cbb3 100644 --- a/src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj +++ b/src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/COM/Activator/Servers/AssemblyContracts.csproj b/src/tests/Interop/COM/Activator/Servers/AssemblyContracts.csproj index fb872e9728d7cf..92f15b7cdc6b8e 100644 --- a/src/tests/Interop/COM/Activator/Servers/AssemblyContracts.csproj +++ b/src/tests/Interop/COM/Activator/Servers/AssemblyContracts.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/COM/NETServer/NETServer.DefaultInterfaces.ilproj b/src/tests/Interop/COM/NETServer/NETServer.DefaultInterfaces.ilproj index f1af2b9c4dedad..852007d0e40fe5 100644 --- a/src/tests/Interop/COM/NETServer/NETServer.DefaultInterfaces.ilproj +++ b/src/tests/Interop/COM/NETServer/NETServer.DefaultInterfaces.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/COM/NETServer/NETServer.csproj b/src/tests/Interop/COM/NETServer/NETServer.csproj index 692bf41ba905b1..0811eaeb0bea09 100644 --- a/src/tests/Interop/COM/NETServer/NETServer.csproj +++ b/src/tests/Interop/COM/NETServer/NETServer.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler.csproj b/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler.csproj index 62f881960dfb6c..f5b3f49b5fa46c 100644 --- a/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler.csproj +++ b/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler.csproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler2.csproj b/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler2.csproj index d4ce512927a3d0..6ff4d64566d732 100644 --- a/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler2.csproj +++ b/src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler2.csproj @@ -1,6 +1,7 @@ library + SharedLibrary $(DefineConstants);CUSTOMMARSHALERS2 diff --git a/src/tests/Interop/NativeLibrary/AssemblyLoadContext/TestAsm/TestAsm.csproj b/src/tests/Interop/NativeLibrary/AssemblyLoadContext/TestAsm/TestAsm.csproj index 1d7ed015cabc3b..2a638a2e57458f 100644 --- a/src/tests/Interop/NativeLibrary/AssemblyLoadContext/TestAsm/TestAsm.csproj +++ b/src/tests/Interop/NativeLibrary/AssemblyLoadContext/TestAsm/TestAsm.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary true diff --git a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.ilproj b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.ilproj index 7eb71cef69df39..3cfdd6869fbff8 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.ilproj +++ b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll1/ManagedDll1.csproj b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll1/ManagedDll1.csproj index e28377ad0818d4..e1be91a4ed6122 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll1/ManagedDll1.csproj +++ b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll1/ManagedDll1.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll2/ManagedDll2.csproj b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll2/ManagedDll2.csproj index e28377ad0818d4..e1be91a4ed6122 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll2/ManagedDll2.csproj +++ b/src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll2/ManagedDll2.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionUtil.ilproj b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionUtil.ilproj index b108bf0349deaa..0be14a6d2c935a 100644 --- a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionUtil.ilproj +++ b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionUtil.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj b/src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj index 329b583c8965fe..1dfc7be2e6ca3c 100644 --- a/src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj +++ b/src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/Interop/UnmanagedCallersOnly/InvalidCSharp.ilproj b/src/tests/Interop/UnmanagedCallersOnly/InvalidCSharp.ilproj index b7b8b4d7665382..5c2e0cc6ca7eb0 100644 --- a/src/tests/Interop/UnmanagedCallersOnly/InvalidCSharp.ilproj +++ b/src/tests/Interop/UnmanagedCallersOnly/InvalidCSharp.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj b/src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj index 020cbd644307b0..03e2fc027748c9 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj +++ b/src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj @@ -1,7 +1,7 @@ Library - false + SharedLibrary diff --git a/src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj b/src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj index 6abc7113422a91..019f625f06346c 100644 --- a/src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj +++ b/src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj @@ -1,7 +1,7 @@ Library - false + SharedLibrary diff --git a/src/tests/Regressions/coreclr/22021/provider.ilproj b/src/tests/Regressions/coreclr/22021/provider.ilproj index a10e6d25b0e4fb..38ea2d326750d2 100644 --- a/src/tests/Regressions/coreclr/22021/provider.ilproj +++ b/src/tests/Regressions/coreclr/22021/provider.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj b/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj index b2aad8af6d976e..a64f2eb5f3a450 100644 --- a/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj +++ b/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj @@ -1,6 +1,7 @@ library + SharedLibrary diff --git a/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj b/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj index d16d855aa32b91..aafab759a16941 100644 --- a/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj +++ b/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj b/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj index 9b614c7ab4e4c3..9bb4f0e74e37d8 100644 --- a/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj +++ b/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj b/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj index 306758e5a5b85f..4895e31531df2e 100644 --- a/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj +++ b/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj b/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj index b916b70076098c..619f5a0bdac2a6 100644 --- a/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj +++ b/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/ilverify/ILTests/ILTests.targets b/src/tests/ilverify/ILTests/ILTests.targets index 73e7592dd3e5ee..cf461072441c97 100644 --- a/src/tests/ilverify/ILTests/ILTests.targets +++ b/src/tests/ilverify/ILTests/ILTests.targets @@ -1,6 +1,7 @@ Library + SharedLibrary $(MSBuildProjectName) $(BaseOutputPathWithConfig)ilverify\Tests diff --git a/src/tests/profiler/unittest/unloadlibrary.csproj b/src/tests/profiler/unittest/unloadlibrary.csproj index 51b3e4b5ee60b3..dacc2154522e04 100644 --- a/src/tests/profiler/unittest/unloadlibrary.csproj +++ b/src/tests/profiler/unittest/unloadlibrary.csproj @@ -2,6 +2,7 @@ .NETCoreApp Library + SharedLibrary true diff --git a/src/tests/reflection/DefaultInterfaceMethods/GetInterfaceMapProvider.ilproj b/src/tests/reflection/DefaultInterfaceMethods/GetInterfaceMapProvider.ilproj index f09b53bac686f5..bc2066caba27ff 100644 --- a/src/tests/reflection/DefaultInterfaceMethods/GetInterfaceMapProvider.ilproj +++ b/src/tests/reflection/DefaultInterfaceMethods/GetInterfaceMapProvider.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/reflection/DefaultInterfaceMethods/InvokeProvider.ilproj b/src/tests/reflection/DefaultInterfaceMethods/InvokeProvider.ilproj index 019f8ee4d532c7..826921c74bc116 100644 --- a/src/tests/reflection/DefaultInterfaceMethods/InvokeProvider.ilproj +++ b/src/tests/reflection/DefaultInterfaceMethods/InvokeProvider.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/reflection/RefEmit/Dependency.csproj b/src/tests/reflection/RefEmit/Dependency.csproj index 809291c86bd6b1..d12b0d15ac3c04 100644 --- a/src/tests/reflection/RefEmit/Dependency.csproj +++ b/src/tests/reflection/RefEmit/Dependency.csproj @@ -1,6 +1,7 @@ Library + SharedLibrary diff --git a/src/tests/reflection/StaticInterfaceMembers/provider.ilproj b/src/tests/reflection/StaticInterfaceMembers/provider.ilproj index a10e6d25b0e4fb..38ea2d326750d2 100644 --- a/src/tests/reflection/StaticInterfaceMembers/provider.ilproj +++ b/src/tests/reflection/StaticInterfaceMembers/provider.ilproj @@ -1,6 +1,7 @@ Library + SharedLibrary