summaryrefslogtreecommitdiff
path: root/tests/tests.targets
blob: 8f00fd749956ddcdcec991cb38936b4c3e838cac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <UsingTask AssemblyFile="$(PackagesDir)xunit.runner.msbuild\$(XunitPackageVersion)\build\portable-net45+win8+wp8+wpa81\xunit.runner.msbuild.dll" TaskName="Xunit.Runner.MSBuild.xunit" />
  
  <ItemGroup>
    <_SkipTestAssemblies Include="$(SkipTestAssemblies)" />
  </ItemGroup>

  <PropertyGroup>
      <TestAssemblyDir Condition="'$(TestAssemblyDir)' == ''">$(BaseOutputPathWithConfig)\tests\</TestAssemblyDir>
      <__TestRunHtmlLog Condition="'$(__TestRunHtmlLog)' == ''">$(__LogsDir)\TestRun.html</__TestRunHtmlLog>
      <__TestRunXmlLog Condition="'$(__TestRunXmlLog)' == ''">$(__LogsDir)\TestRun.xml</__TestRunXmlLog>
  </PropertyGroup>
  <Target Name="FindTestDirectories">
    <ItemGroup>
      <AllTestAssemblies Include="$(BaseOutputPathWithConfig)\**\*.XUnitWrapper.dll" />
      <TestAssemblies Include="@(AllTestAssemblies)" Exclude="@(_SkipTestAssemblies -> '$(TestAssemblyDir)%(Identity)\%(Identity).XUnitWrapper.dll')" />
    </ItemGroup>
    
    <Error  Text=" The wrappers must be compiled and placed at $(TestAssemblyDir)\*\ before they can be run, Do a clean Test Run"
            Condition="'@(AllTestAssemblies)' == ''" />
    
    <Message Text= "AllTestAssemblies= @(AllTestAssemblies)"/>
    <Message Text= "TestAssemblies= @(TestAssemblies)"/>
    <Message Text= "_SkipTestAssemblies= @(_SkipTestAssemblies -> '$(TestAssemblyDir)%(Identity)\%(Identity).XUnitWrapper.dll')"/>
  </Target>

  <UsingTask
    AssemblyFile="$(SourceDir)\packages\xunit.runner.msbuild\$(XunitPackageVersion)\build\portable-net45+win8+wp8+wpa81\xunit.runner.msbuild.dll"
    TaskName="Xunit.Runner.MSBuild.xunit" />

   <Target Name="RunTests"
          DependsOnTargets="FindTestDirectories"
          Condition="'$(SkipTests)' != 'True'">


    <PropertyGroup>
      <ExcludeTraits Condition="'$(ExcludeTraits)'==''">category=outerloop;category=failing</ExcludeTraits>
      <ParallelRun Condition="'$(ParallelRun)'==''">true</ParallelRun>
    </PropertyGroup>
    <ItemGroup>
      <IncludeTraitsItems Include="$(IncludeTraits)" />
      <ExcludeTraitsItems Include="$(ExcludeTraits)" />
    </ItemGroup>

    <xunit Assemblies="@(TestAssemblies)"
      ParallelizeAssemblies="$(ParallelRun)"
      ParallelizeTestCollections="$(ParallelRun)"
      Html="$(__TestRunHtmlLog)"
      Xml="$(__TestRunXmlLog)"
      IncludeTraits="@(IncludeTraitsItems)"
      ExcludeTraits="@(ExcludeTraitsItems)" /> 

  </Target>

</Project>