According to the blogpost about „HowTo: build solutions with MSBuild“ I’m going to show you a little example about how to call MSTests.ScenarioThe structure is nearly the same like in this blogpost. As a little add-on I created a new test project:
I’ve added one more “RunTests” target to my BuildSolutions.target file where the MSBuild Script is included: <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
I’ve added one more “RunTests” target to my BuildSolutions.target file where the MSBuild Script is included: <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<OutDir>$(MSBuildStartupDirectory)\OutDir\</OutDir><SolutionProperties>OutDir=$(OutDir);Platform=Any CPU;Configuration=Release</SolutionProperties>
</PropertyGroup>
<ItemGroup>
<Solution Include="..\MsBuildSample.sln"><Properties>$(SolutionProperties)</Properties></Solution>
</ItemGroup>
<Target Name="Build">
<MSBuild Projects="@(Solution)"/></Target><Target Name="RunTests"><Exec Command='"C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\mstest.exe" /testcontainer:"$(MSBuildStartupDirectory)\OutDir\MsBuildSample.WebApp.Tests.dll" /testcontainer:"$(MSBuildStartupDirectory)\OutDir\AnotherTestProject.dll"' />
</Target></Project>Read more: Code-Inside Blog International
0 comments:
Post a Comment