Merge pull request #16268 from CarolEidt/Fix16254
[platform/upstream/coreclr.git] / tests / tests.targets
index 87b7f00..8f00fd7 100644 (file)
@@ -1,47 +1,43 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
-  <UsingTask AssemblyFile="$(PackagesDir)xunit.runners\2.0.0-beta5-build2785\tools\xunit.runner.msbuild.dll" TaskName="Xunit.Runner.MSBuild.xunit" />
+  <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\XunitRunner\</TestAssemblyDir>
+      <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="$(TestAssemblyDir)*.XUnitWrapper.dll" />
-      <TestAssemblies Include="@(AllTestAssemblies)" Exclude="@(_SkipTestAssemblies -> '$(TestAssemblyDir)%(Identity).XUnitWrapper.dll')" />
+      <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"
+    <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).XUnitWrapper.dll')"/>
+    <Message Text= "_SkipTestAssemblies= @(_SkipTestAssemblies -> '$(TestAssemblyDir)%(Identity)\%(Identity).XUnitWrapper.dll')"/>
   </Target>
-   <PropertyGroup>
-      <ThisTestWorkingDir>$(TestAssemblyDir)\</ThisTestWorkingDir>
-  </PropertyGroup>
 
   <UsingTask
-    AssemblyFile="$(SourceDir)\packages\xunit.abstractions\$(XunitVersionCompiled)\lib\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid\xunit.runner.msbuild.dll"
+    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"
-          Inputs="@(TestAssemblies)"
-          Outputs="$(ThisTestWorkingDir)\*.*"
           Condition="'$(SkipTests)' != 'True'">
 
 
     <PropertyGroup>
       <ExcludeTraits Condition="'$(ExcludeTraits)'==''">category=outerloop;category=failing</ExcludeTraits>
+      <ParallelRun Condition="'$(ParallelRun)'==''">true</ParallelRun>
     </PropertyGroup>
     <ItemGroup>
       <IncludeTraitsItems Include="$(IncludeTraits)" />
@@ -49,9 +45,8 @@
     </ItemGroup>
 
     <xunit Assemblies="@(TestAssemblies)"
-      WorkingFolder="$(ThisTestWorkingDir)"
-      ParallelizeAssemblies="True"
-      ParallelizeTestCollections="True"
+      ParallelizeAssemblies="$(ParallelRun)"
+      ParallelizeTestCollections="$(ParallelRun)"
       Html="$(__TestRunHtmlLog)"
       Xml="$(__TestRunXmlLog)"
       IncludeTraits="@(IncludeTraitsItems)"