Skip to content

Commit

Permalink
Provide an msbuild target for just running tests
Browse files Browse the repository at this point in the history
Sometimes, you want to build and run the tests repeatedly from the command line (especially if, like me, you don't trust the built-in visual studio test runners). These new msbuild targets makes that easier, while still preserving the existing behaviour of  /t:Test .

The new msbuild targets are:
•  /t:TestOnly  - only runs the test commands, without attempting clean/rebuild//verify.
•  /t:BuildAndTestOnly  - only runs the build and test targets, without attempting clean/rebuild/verify
  • Loading branch information
adamchester committed Dec 30, 2015
1 parent 32aadea commit 7017353
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion BuildRelease.msbuild
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<Target Name="Build" DependsOnTargets="Verify">
<MSBuild Projects="@(ProjectToBuild)" Properties="Configuration=Release" />
</Target>
<Target Name="Test" DependsOnTargets="Build">
<Target Name="TestOnly" >
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<ParallelizeTests Condition="'$(ParallelizeTests)' == ''">false</ParallelizeTests>
Expand All @@ -121,6 +121,13 @@
<NUnit ToolPath="$(NUnitToolsFolder)" Assemblies="Src\AutoFixture.NUnit2.UnitTest\bin\Release\Ploeh.AutoFixture.NUnit2.UnitTest.dll" ContinueOnError="true" />
<NUnit ToolPath="$(NUnitToolsFolder)" Assemblies="Src\AutoFixture.NUnit2.Addins.UnitTest\bin\Release\Ploeh.AutoFixture.NUnit2.Addins.UnitTest.dll" OutputXmlFile="TestResult-Addins.xml" ContinueOnError="true" />
</Target>
<Target Name="BuildAndTestOnly">
<MSBuild Projects="@(ProjectToBuild)" Properties="Configuration=Release" />
<CallTarget Targets="TestOnly" />
</Target>
<Target Name="Test" DependsOnTargets="Build">
<CallTarget Targets="TestOnly" />
</Target>
<Target Name="DeleteTestResultFiles" DependsOnTargets="Test">
<Delete Files="TestResult.xml" />
<Delete Files="TestResult-Addins.xml" />
Expand Down

0 comments on commit 7017353

Please sign in to comment.