Skip to content

Commit

Permalink
Avoid running tests against non-test projects (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfederm committed Mar 8, 2024
1 parent fe8bb08 commit 363532d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/RunTests/build/Microsoft.Build.RunVSTest.targets
Expand Up @@ -5,8 +5,8 @@
Licensed under the MIT license.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Microsoft.Build.RunVSTestTask" AssemblyFile="$(MSBuildThisFileDirectory)netstandard2.0\Microsoft.Build.RunVSTest.dll" Condition="'$(MSBuildRuntime)' != 'Core'"/>
<Target Name="RunVSTest" AfterTargets="Test" Condition="'$(MSBuildRuntime)' != 'Core'">
<UsingTask TaskName="Microsoft.Build.RunVSTestTask" AssemblyFile="$(MSBuildThisFileDirectory)netstandard2.0\Microsoft.Build.RunVSTest.dll" Condition="'$(IsTestProject)' == 'true' and '$(MSBuildRuntime)' != 'Core'"/>
<Target Name="RunVSTest" AfterTargets="Test" Condition="'$(IsTestProject)' == 'true' and '$(MSBuildRuntime)' != 'Core'">
<RunVSTestTask
TestFileFullPath="$(TargetPath)"
VSTestSetting="$(VSTestSetting)"
Expand All @@ -33,7 +33,7 @@
VSTestSessionCorrelationId="$(VSTestSessionCorrelationId)"
/>
</Target>
<Target Name="ForceRunVSTest" AfterTargets="Test" Condition="'$(MSBuildRuntime)' == 'Core'" >
<Target Name="ForceRunVSTest" AfterTargets="Test" Condition="'$(IsTestProject)' == 'true' and '$(MSBuildRuntime)' == 'Core'" >
<CallTarget Targets="VSTest" />
</Target>
</Project>

0 comments on commit 363532d

Please sign in to comment.