Explicitly mark tests with CLRTestKind=SharedLibrary (#61235)
authorTomáš Rylek <trylek@microsoft.com>
Thu, 11 Nov 2021 00:02:28 +0000 (01:02 +0100)
committerGitHub <noreply@github.com>
Thu, 11 Nov 2021 00:02:28 +0000 (01:02 +0100)
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

32 files changed:
src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.csproj
src/tests/Directory.Build.targets
src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj
src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj
src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj
src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj
src/tests/Interop/COM/Activator/Servers/AssemblyContracts.csproj
src/tests/Interop/COM/NETServer/NETServer.DefaultInterfaces.ilproj
src/tests/Interop/COM/NETServer/NETServer.csproj
src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler.csproj
src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler2.csproj
src/tests/Interop/NativeLibrary/AssemblyLoadContext/TestAsm/TestAsm.csproj
src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.ilproj
src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll1/ManagedDll1.csproj
src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll2/ManagedDll2.csproj
src/tests/Interop/SuppressGCTransition/SuppressGCTransitionUtil.ilproj
src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj
src/tests/Interop/UnmanagedCallersOnly/InvalidCSharp.ilproj
src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj
src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj
src/tests/Regressions/coreclr/22021/provider.ilproj
src/tests/baseservices/callconvs/CallFunctionPointers.ilproj
src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj
src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj
src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj
src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj
src/tests/ilverify/ILTests/ILTests.targets
src/tests/profiler/unittest/unloadlibrary.csproj
src/tests/reflection/DefaultInterfaceMethods/GetInterfaceMapProvider.ilproj
src/tests/reflection/DefaultInterfaceMethods/InvokeProvider.ilproj
src/tests/reflection/RefEmit/Dependency.csproj
src/tests/reflection/StaticInterfaceMembers/provider.ilproj

index 249c25e..73107e7 100644 (file)
@@ -1,5 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
+    <OutputType>exe</OutputType>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <CLRTestPriority>1</CLRTestPriority>
   </PropertyGroup>
index 9409873..2866110 100644 (file)
@@ -11,7 +11,6 @@
 
   <!-- Default priority building values. -->
   <PropertyGroup>
-    <CLRTestKind Condition="'$(CLRTestKind)' == '' and '$(OutputType)' == 'Library'">SharedLibrary</CLRTestKind>
     <CLRTestKind Condition="'$(CLRTestKind)' == ''">BuildAndRun</CLRTestKind>
     <CLRTestPriority Condition="'$(CLRTestPriority)' == ''">0</CLRTestPriority>
   </PropertyGroup>
index b32d3ba..d7efb6b 100644 (file)
@@ -3,6 +3,7 @@
     <TestRuntime>true</TestRuntime>
     <DeltaScript>deltascript.json</DeltaScript>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
     <!-- to call AsssemblyExtensions.ApplyUpdate we need Optimize=false, EmitDebugInformation=true in all configurations -->
     <Optimize>false</Optimize>
     <EmitDebugInformation>true</EmitDebugInformation>
index f45dd13..e89acac 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="AssemblyA.cs" />
index 06f1844..e167fbf 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="AssemblyB.cs" />
index 9838175..77484f4 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="AssemblyC.cs" />
index fb872e9..92f15b7 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="AssemblyContracts.cs" />
index f1af2b9..852007d 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="NETServer.DefaultInterfaces.il" />
index 692bf41..0811eae 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="*.cs" />
index 62f8819..f5b3f49 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="CustomMarshaler.cs" />
index d4ce512..6ff4d64 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
     <DefineConstants>$(DefineConstants);CUSTOMMARSHALERS2</DefineConstants>
   </PropertyGroup>
   <ItemGroup>
index 1d7ed01..2a638a2 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <ItemGroup>
index 7eb71ce..3cfdd68 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="CopyCtorUtil.il" />
index e28377a..e1be91a 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="$(MSBuildProjectName).cs" />
index e28377a..e1be91a 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="$(MSBuildProjectName).cs" />
index b108bf0..0be14a6 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="SuppressGCTransitionUtil.il" />
index 329b583..1dfc7be 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="PInvokesIL.il" />
index b7b8b4d..5c2e0cc 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="InvalidCallbacks.il" />
index 020cbd6..03e2fc0 100644 (file)
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Library</OutputType>
-    <GenerateRunScript>false</GenerateRunScript>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <PropertyGroup>
     <DebugType />
index 6abc711..019f625 100644 (file)
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Library</OutputType>
-    <GenerateRunScript>false</GenerateRunScript>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <PropertyGroup>
     <DebugType />
index a10e6d2..38ea2d3 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="provider.il" />
index b2aad8a..a64f2eb 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="CallFunctionPointers.il" />
index d16d855..aafab75 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="StringThrower.il" />
index 9b614c7..9bb4f0e 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="moduleCctor.il" />
index 306758e..4895e31 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="Types.cs" />
index b916b70..619f5a0 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="Impls.cs" />
index 73e7592..cf46107 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
     <AssemblyName>$(MSBuildProjectName)</AssemblyName>
     <OutputPath>$(BaseOutputPathWithConfig)ilverify\Tests</OutputPath>
   </PropertyGroup>
index 51b3e4b..dacc215 100644 (file)
@@ -2,6 +2,7 @@
   <PropertyGroup>
     <TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
     <Optimize>true</Optimize>
   </PropertyGroup>
   <ItemGroup>
index f09b53b..bc2066c 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="GetInterfaceMapProvider.il" />
index 019f8ee..826921c 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="InvokeProvider.il" />
index 809291c..d12b0d1 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="Dependency.cs" />
index a10e6d2..38ea2d3 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk.IL">
   <PropertyGroup>
     <OutputType>Library</OutputType>
+    <CLRTestKind>SharedLibrary</CLRTestKind>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="provider.il" />