-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
net8.0-windows
tests trying to run on Linux
This also enforces which target frameworks are permitted for test projects to avoid mistakes that would cause tests to be silently skipped on CI.
- Loading branch information
1 parent
76b9d9d
commit cf0f86a
Showing
6 changed files
with
36 additions
and
11 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