Source

SubSpec / SubSpec.tests.msbuild

Full commit
<Project DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">

  <PropertyGroup>
    <Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
  </PropertyGroup>

  <UsingTask
      AssemblyFile="tools\xunit.runner.msbuild.dll"
      TaskName="Xunit.Runner.MSBuild.xunit"/>

  <ItemGroup>
    <TestAssemblies
        Include="test\*\bin\$(Configuration)\*.Tests.dll" />
    <SilverlightTestXaps
            Include="test\*\bin\SL4\$(Configuration)\*.xap" />
  </ItemGroup>

  <Target Name="Test" DependsOnTargets="xUnitTests;SilverlightTests">
    <Error Text="xUnit Test error(s) occured" Code="%(xUnitExitCodes.Identity)" Condition=" '%(xUnitExitCodes.Identity)' != '0' And '@(TestAssemblies)' != ''"/>
    <Error Text="StatLight (Silverlight) Test error(s) occured" Code="%(StatLightExitCodes.Identity)" Condition=" '%(StatLightExitCodes.Identity)' != '0' And '@(SilverlightTestXaps)' != ''"/>
  </Target>

  <Target Name="xUnitTests">
    <xunit
      Assemblies="@(TestAssemblies)"
      Xml="build\TestResults-$(PROCESSOR_ARCHITECTURE).xml"
      Html="build\TestResults-$(PROCESSOR_ARCHITECTURE).html"
      ContinueOnError="true">
      
      <Output TaskParameter="ExitCode" ItemName="xUnitExitCodes"/>
    
    </xunit>
  </Target>

  <Target Name="SilverlightTests">
    <Exec 
      Command="&quot;tools\StatLight\StatLight.exe&quot; @(SilverlightTestXaps -> '-x=&quot;%(Identity)&quot;', ' ') --teamcity -r=&quot;build\TestResults.Silverlight-$(PROCESSOR_ARCHITECTURE).xml&quot;"
      ContinueOnError="true">

      <Output TaskParameter="ExitCode" ItemName="StatLightExitCodes"/>
    
    </Exec>
  </Target>
</Project>