Skip to content

Commit

Permalink
Add unit test execution with nunit console
Browse files Browse the repository at this point in the history
  • Loading branch information
rmsantos committed Mar 9, 2015
1 parent e02e076 commit 8b501dc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions src/BuildScripts/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

<Import Project="common.props"/>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.targets"/>


<Target Name="ci" DependsOnTargets="clean;nugetRestore;version;build;unittest;publish;archive"/>

<!--Restore Nuget Packages-->
<Target Name="nugetRestore">
<NuGetRestore Solution ="$(SolutionPath)" />
</Target>

<!--Target to clean output folder if exists-->
<Target Name="clean">
<RemoveDir Directories="$(OutputPath)" Condition="Exists($(OutputPath))" />
</Target>

<!--Target to create assembly version info-->
<Target Name="version">
<Time>
Expand All @@ -38,40 +38,42 @@
AssemblyVersion="$(Version)"
AssemblyFileVersion="$(FileVersion)"
AssemblyInformationalVersion="$(InformationalVersion)" />

</Target>

<!--Target to build solution using the sln file-->
<Target Name="build" DependsOnTargets="clean">
<Message Text="Building $(SolutionFileName)"/>

<MSBuild Projects="$(SolutionFileName)" Properties="Configuration=$(BuildConfiguration);OutputPath=$(OutputPath)"/>

</Target>


<ItemGroup>
<UnitTestAssemblies Include="$(OutputPath)\.Tests.dll"/>
<UnitTestAssemblies Include="$(OutputPath)\*.Tests.dll"/>
</ItemGroup>

<Target Name="unittest" Condition="'$(UnitTest)'" DependsOnTargets="build">
<Message Text="Running Unit Tests..."/>
<NUnit Assemblies="@(UnitTestAssemblies)">

</NUnit>


<Exec Command="nunit-console @(UnitTestAssemblies->'%(FullPath)',' ') /nologo"/>





<Message Text="Unit Tests Done."/>
</Target>

<Target Name="publish" Condition="'$(Publish)'" DependsOnTargets="unittest">
<Message Text="Publishing..."/>

</Target>

<Target Name="archive" Condition="'$(Archive)'" DependsOnTargets="publish">
<Message Text="Archiving..."/>

</Target>

</Project>
2 changes: 1 addition & 1 deletion src/BuildScripts/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PropertyGroup>

<Publish Condition="'$(Publish)' == ''" >true</Publish>
<Archive Condition="'$(Arquive)' == ''">true</Archive>
<Archive Condition="'$(Archive)' == ''">true</Archive>
<UnitTest Condition="'$(UnitTest)' == ''">false</UnitTest>

</PropertyGroup>
Expand Down

0 comments on commit 8b501dc

Please sign in to comment.