-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1958 from PathogenDavid/issue-1948-fixup
Fix test target framework issues
- Loading branch information
Showing
6 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<!-- Common test properties --> | ||
<IsPackable>false</IsPackable> | ||
<GenerateDocumentationFile>false</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
<Target Name="VerifyTestTargetFramework" BeforeTargets="Build" Condition="'$(TargetFramework)' != ''"> | ||
<ItemGroup> | ||
<!-- | ||
Due to limitations in `dotnet test`, tests must only target specific target frameworks which are explicitly ran by CI. | ||
Do not add any target frameworks to this list without also updating the CI workflow. | ||
--> | ||
<_PermittedTestFramework Remove="*" /> | ||
<_PermittedTestFramework Include="net472" /> | ||
<_PermittedTestFramework Include="net8.0" /> | ||
<_PermittedTestFramework Include="net8.0-windows" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<_IsPermittedTestFramework>false</_IsPermittedTestFramework> | ||
<_IsPermittedTestFramework Condition="'%(_PermittedTestFramework.Identity)' == '$(TargetFramework)'">true</_IsPermittedTestFramework> | ||
</PropertyGroup> | ||
<Error Condition="'$(_IsPermittedTestFramework)' != 'true'" Text="Test project targets '$(TargetFramework)', which is not permitted for test projects." /> | ||
</Target> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters