-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make dotnet test execute only test projects (#86)
This change modifies the VSTest target to ensure that the VSTest target gets executed for test projects only. The solution for the problem is based on: https://dasmulli.blog/2018/01/20/make-dotnet-test-work-on-solution-files/
- Loading branch information
1 parent
ae1f568
commit 7f529a0
Showing
2 changed files
with
14 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project> | ||
<Target Name="VSTestIfTestProject"> | ||
<!-- Change VSTest to call only projects where IsTestProject is defined. | ||
This gets defined in Microsoft.NET.Test.Sdk and hence | ||
VSTest is run only on test projects. --> | ||
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" /> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Project> | ||
<Target Name="VSTest"> | ||
<MSBuild Projects="@(ProjectReference)" Targets="VSTestIfTestProject" /> | ||
</Target> | ||
</Project> |