MSBuild.SolutionSdk
MSBuild.SolutionSdk copied to clipboard
VSTest Target
In my SnowShovel project I'm using an slnproj file to run my tests:
<Target Name="VSTest">
<ItemGroup>
<TestProjects Include="tests/**/*.csproj" />
</ItemGroup>
<MSBuild Projects="@(TestProjects)" Targets="VSTest" />
</Target>
Tests can then be executed with the dotnet cli:
dotnet test SnowShovel.slnproj
I feel like this should be in the box. I'm willing to create a pull request if you can assist me in how to test changes in the project.
Good idea, the VSTest target should be in the box indeed. However I don't want to force a convention by having to put the test projects in a tests/ folder and I'd prefer if it just worked without having to specify the test projects.
All test project define the $(IsTestProject) msbuild property, I think the VSTest target could automagically include only these projects.
I have started a refactoring to use the msbuild sdk, this allows to query the csproj properties and make this feature possible.
I should be able to find some time in a couple of weeks to finish the refactoring and implement this feature, I'll leave the issue open for tracking.
Thanks for the proposal
Cool, I didn't know about this property $(IsTestProject). If you can use that to identify the test projects then that is better than enforcing the convention that all test projects are under the tests
directory.