Skip to content

Commit

Permalink
Explicitly mark tests with CLRTestKind=SharedLibrary (#61235)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
trylek committed Nov 11, 2021
1 parent 9a883b5 commit fd64e64
Show file tree
Hide file tree
Showing 32 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 1 addition & 0 deletions src/tests/Interop/COM/Activator/Servers/AssemblyA.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyA.cs" />
Expand Down
1 change: 1 addition & 0 deletions src/tests/Interop/COM/Activator/Servers/AssemblyB.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyB.cs" />
Expand Down
1 change: 1 addition & 0 deletions src/tests/Interop/COM/Activator/Servers/AssemblyC.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyC.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyContracts.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="NETServer.DefaultInterfaces.il" />
Expand Down
1 change: 1 addition & 0 deletions src/tests/Interop/COM/NETServer/NETServer.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="*.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="CustomMarshaler.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
<DefineConstants>$(DefineConstants);CUSTOMMARSHALERS2</DefineConstants>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="CopyCtorUtil.il" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="SuppressGCTransitionUtil.il" />
Expand Down
1 change: 1 addition & 0 deletions src/tests/Interop/UnmanagedCallConv/PInvokesIL.ilproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="PInvokesIL.il" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="InvalidCallbacks.il" />
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Regression/JitBlue/GitHub_22583/base.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<GenerateRunScript>false</GenerateRunScript>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<PropertyGroup>
<DebugType />
Expand Down
2 changes: 1 addition & 1 deletion src/tests/JIT/Regression/JitBlue/GitHub_22583/lib.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<GenerateRunScript>false</GenerateRunScript>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<PropertyGroup>
<DebugType />
Expand Down
1 change: 1 addition & 0 deletions src/tests/Regressions/coreclr/22021/provider.ilproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="provider.il" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="CallFunctionPointers.il" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="StringThrower.il" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="moduleCctor.il" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="Types.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="Impls.cs" />
Expand Down
1 change: 1 addition & 0 deletions src/tests/ilverify/ILTests/ILTests.targets
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
1 change: 1 addition & 0 deletions src/tests/profiler/unittest/unloadlibrary.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
<Optimize>true</Optimize>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="GetInterfaceMapProvider.il" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="InvokeProvider.il" />
Expand Down
1 change: 1 addition & 0 deletions src/tests/reflection/RefEmit/Dependency.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="Dependency.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Library</OutputType>
<CLRTestKind>SharedLibrary</CLRTestKind>
</PropertyGroup>
<ItemGroup>
<Compile Include="provider.il" />
Expand Down

0 comments on commit fd64e64

Please sign in to comment.