Skip to content

Commit fd64e64

Browse files
authored
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
1 parent 9a883b5 commit fd64e64

File tree

32 files changed

+31
-3
lines changed

32 files changed

+31
-3
lines changed

src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3+
<OutputType>exe</OutputType>
34
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
45
<CLRTestPriority>1</CLRTestPriority>
56
</PropertyGroup>

src/tests/Directory.Build.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
<!-- Default priority building values. -->
1313
<PropertyGroup>
14-
<CLRTestKind Condition="'$(CLRTestKind)' == '' and '$(OutputType)' == 'Library'">SharedLibrary</CLRTestKind>
1514
<CLRTestKind Condition="'$(CLRTestKind)' == ''">BuildAndRun</CLRTestKind>
1615
<CLRTestPriority Condition="'$(CLRTestPriority)' == ''">0</CLRTestPriority>
1716
</PropertyGroup>

src/tests/FunctionalTests/WebAssembly/Browser/HotReload/ApplyUpdateReferencedAssembly/ApplyUpdateReferencedAssembly.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<TestRuntime>true</TestRuntime>
44
<DeltaScript>deltascript.json</DeltaScript>
55
<OutputType>library</OutputType>
6+
<CLRTestKind>SharedLibrary</CLRTestKind>
67
<!-- to call AsssemblyExtensions.ApplyUpdate we need Optimize=false, EmitDebugInformation=true in all configurations -->
78
<Optimize>false</Optimize>
89
<EmitDebugInformation>true</EmitDebugInformation>

src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="AssemblyA.cs" />

src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="AssemblyB.cs" />

src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="AssemblyC.cs" />

src/tests/Interop/COM/Activator/Servers/AssemblyContracts.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="AssemblyContracts.cs" />

src/tests/Interop/COM/NETServer/NETServer.DefaultInterfaces.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="NETServer.DefaultInterfaces.il" />

src/tests/Interop/COM/NETServer/NETServer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="*.cs" />

src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="CustomMarshaler.cs" />

src/tests/Interop/ICustomMarshaler/ConflictingNames/CustomMarshaler2.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
<DefineConstants>$(DefineConstants);CUSTOMMARSHALERS2</DefineConstants>
56
</PropertyGroup>
67
<ItemGroup>

src/tests/Interop/NativeLibrary/AssemblyLoadContext/TestAsm/TestAsm.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
56
</PropertyGroup>
67
<ItemGroup>

src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorUtil.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="CopyCtorUtil.il" />

src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll1/ManagedDll1.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="$(MSBuildProjectName).cs" />

src/tests/Interop/PInvoke/Miscellaneous/MultipleAssembliesWithSamePInvoke/ManagedDll2/ManagedDll2.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="$(MSBuildProjectName).cs" />

src/tests/Interop/SuppressGCTransition/SuppressGCTransitionUtil.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="SuppressGCTransitionUtil.il" />

src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="PInvokesIL.il" />

src/tests/Interop/UnmanagedCallersOnly/InvalidCSharp.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="InvalidCallbacks.il" />

src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4-
<GenerateRunScript>false</GenerateRunScript>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
55
</PropertyGroup>
66
<PropertyGroup>
77
<DebugType />

src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4-
<GenerateRunScript>false</GenerateRunScript>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
55
</PropertyGroup>
66
<PropertyGroup>
77
<DebugType />

src/tests/Regressions/coreclr/22021/provider.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="provider.il" />

src/tests/baseservices/callconvs/CallFunctionPointers.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="CallFunctionPointers.il" />

src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="StringThrower.il" />

src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="moduleCctor.il" />

src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="Types.cs" />

src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="Impls.cs" />

src/tests/ilverify/ILTests/ILTests.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
56
<OutputPath>$(BaseOutputPathWithConfig)ilverify\Tests</OutputPath>
67
</PropertyGroup>

src/tests/profiler/unittest/unloadlibrary.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<PropertyGroup>
33
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
44
<OutputType>Library</OutputType>
5+
<CLRTestKind>SharedLibrary</CLRTestKind>
56
<Optimize>true</Optimize>
67
</PropertyGroup>
78
<ItemGroup>

src/tests/reflection/DefaultInterfaceMethods/GetInterfaceMapProvider.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="GetInterfaceMapProvider.il" />

src/tests/reflection/DefaultInterfaceMethods/InvokeProvider.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="InvokeProvider.il" />

src/tests/reflection/RefEmit/Dependency.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="Dependency.cs" />

src/tests/reflection/StaticInterfaceMembers/provider.ilproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.IL">
22
<PropertyGroup>
33
<OutputType>Library</OutputType>
4+
<CLRTestKind>SharedLibrary</CLRTestKind>
45
</PropertyGroup>
56
<ItemGroup>
67
<Compile Include="provider.il" />

0 commit comments

Comments
 (0)