sample2adv.proj (21 lines of code) (raw):
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="RunTests" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="nunit-utils.targets"/>
<Target Name="RunTests">
<GetNUnitConsolePath BaseDir="$(MSBuildProjectDirectory)\packages">
<Output TaskParameter="PathToNUnitConsole" ItemName="pathToNUnitConsole"/>
</GetNUnitConsolePath>
<Message Text="Path of NUnit console: @(pathToNUnitConsole)" Importance="high"/>
<ItemGroup>
<Assemblies Include="*.dll"/>
</ItemGroup>
<CreateNUnitListOfAssemblies Assemblies="@(Assemblies)" RegexpAssemblyFilter=".*Tests.dll$">
<Output TaskParameter="ListOfAssemblies" ItemName="listOfAssemblies"/>
</CreateNUnitListOfAssemblies>
<Message Text="The list of assemblies: @(listOfAssemblies)" Importance="high"/>
<Exec IgnoreExitCode="True" Command="@(pathToNUnitConsole) @(listOfAssemblies) --noresult --noheader --where cat=Sample2">
<Output TaskParameter="ExitCode" ItemName="exitCode"/>
</Exec>
<Error Text="Error while running tests" Condition="@(exitCode) < 0" />
</Target>
</Project>