Skip to content

Commit

Permalink
Make dotnet test execute only test projects (#86)
Browse files Browse the repository at this point in the history
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
frederik-h authored and Mukul Sabharwal committed Dec 5, 2018
1 parent ae1f568 commit 7f529a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Directory.Build.targets
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>

5 changes: 5 additions & 0 deletions after.LLVMSharp.sln.targets
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>

0 comments on commit 7f529a0

Please sign in to comment.