Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid running tests against non-test projects #541

Merged
merged 1 commit into from Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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>