2017-01-22 14:40:00 -08:00
<Project ToolsVersion="14.0" DefaultTargets="Test">
2016-07-13 12:52:33 -07:00
<Import Project="test/TestPackageProjects.targets" />
2016-07-15 00:20:23 -07:00
<Import Project="test/TestProjects.targets" />
2016-07-11 12:46:27 -07:00
2017-02-22 09:25:06 -08:00
<PropertyGroup>
<PathListSeparator>:</PathListSeparator>
<PathListSeparator Condition=" '$(OSName)' == 'win' ">%3b</PathListSeparator>
2017-02-27 11:06:44 -08:00
<ExecPath>$(OutputDirectory)$(PathListSeparator)$(PATH)</ExecPath>
<ExecPath Condition=" '$(OSName)' == 'win' ">$(OutputDirectory)</ExecPath>
2017-02-23 17:07:26 -08:00
<TestPackagesDir>$(TestOutputDir)/packages/</TestPackagesDir>
<TestArtifactsDir>$(TestOutputDir)/artifacts/</TestArtifactsDir>
<TestResultXmlDir>$(TestOutputDir)/results/</TestResultXmlDir>
2017-02-22 09:25:06 -08:00
</PropertyGroup>
2016-11-11 21:46:29 -10:00
2017-02-22 09:25:06 -08:00
<ItemGroup>
<TestTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsDir)" />
</ItemGroup>
2016-07-11 12:46:27 -07:00
2017-02-22 09:25:06 -08:00
<PropertyGroup>
<RunTestEnvironmentVariables>@(TestTaskEnvironmentVariables)</RunTestEnvironmentVariables>
</PropertyGroup>
2016-07-11 12:46:27 -07:00
2017-02-22 09:25:06 -08:00
<Target Name="Test"
Condition=" '$(CLIBUILD_SKIP_TESTS)' != 'true' "
DependsOnTargets="BuildTests;">
2016-08-09 15:19:34 -07:00
<ItemGroup>
<ProjectsToTest Include="build/test/RunTest.proj">
<Properties>
2017-02-27 11:06:44 -08:00
CLIBuildDll=$(CLIBuildDll);
2016-08-09 15:19:34 -07:00
Configuration=$(Configuration);
EnvironmentVariables=$(RunTestEnvironmentVariables);
2017-01-22 14:40:00 -08:00
TestProject=%(TestProjects.Identity);
2016-08-09 15:19:34 -07:00
TestResultXmlDir=$(TestResultXmlDir);
2017-02-27 11:06:44 -08:00
ToolPath=$(OutputDirectory);
WorkingDirectory=$([System.IO.Directory]::GetParent(%(TestProjects.Identity)))
2016-08-09 15:19:34 -07:00
</Properties>
</ProjectsToTest>
</ItemGroup>
2016-12-13 14:15:35 -08:00
<Message Text="Starting test execution" Importance="High" />
2016-08-09 15:19:34 -07:00
<MSBuild
BuildInParallel="True"
Projects="@(ProjectsToTest)">
</MSBuild>
2016-12-13 14:15:35 -08:00
<Message Text="Finished test execution" Importance="High" />
2016-07-11 12:46:27 -07:00
</Target>
<Target Name="PrepareTests"
2017-01-22 14:40:00 -08:00
DependsOnTargets="Init;
SetupTestProjectData">
2017-01-10 10:43:05 -08:00
<MakeDir Directories="$(TestPackagesDir)" Condition="!Exists('$(TestPackagesDir)')"/>
2016-07-11 12:46:27 -07:00
</Target>
<Target Name="RestoreTests"
2017-01-22 14:40:00 -08:00
DependsOnTargets="PrepareTests;
CreateTestAssetPackageNuPkgs;">
2017-02-27 20:45:26 -08:00
<DotNetRestore ToolPath="$(OutputDirectory)"
2017-01-18 12:04:18 -08:00
ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln"" />
2016-07-11 12:46:27 -07:00
</Target>
2017-01-22 14:40:00 -08:00
<Target Name="BuildTests"
DependsOnTargets="RestoreTests;">
2017-02-27 20:45:26 -08:00
<DotNetBuild ToolPath="$(OutputDirectory)"
2017-02-28 19:30:43 -08:00
ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln""
MaxCpuCount="1" />
2016-07-11 12:46:27 -07:00
</Target>
2016-08-09 15:19:34 -07:00
<Target Name="CreateTestAssetPackageNuPkgs"
2017-01-22 14:40:00 -08:00
DependsOnTargets="SetupTestPackageProjectData;"
2017-01-26 11:47:06 -08:00
Outputs="%(TestPackageProject.Identity)">
2017-01-09 16:49:57 -08:00
2017-02-27 11:06:44 -08:00
<DotNetRestore ToolPath="$(OutputDirectory)"
2017-02-13 13:06:30 -08:00
WorkingDirectory="$([System.IO.Directory]::GetParent('%(TestPackageProject.ProjectPath)'))"
2017-01-10 10:43:05 -08:00
ProjectPath="%(TestPackageProject.ProjectPath)" />
2017-01-25 16:28:35 -08:00
2016-12-09 00:30:02 -08:00
<!-- https://github.com/NuGet/Home/issues/4063 -->
2017-01-25 16:28:35 -08:00
<DotNetPack Output="$(TestPackagesDir)"
2016-11-15 12:12:28 -10:00
ProjectPath="%(TestPackageProject.ProjectPath)"
2017-02-27 20:45:26 -08:00
ToolPath="$(OutputDirectory)"
2016-11-15 12:12:28 -10:00
VersionSuffix="%(TestPackageProject.VersionSuffix)"
2017-01-26 10:56:30 -08:00
MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion)" />
2016-11-14 14:26:03 -08:00
</Target>
2017-01-27 00:45:59 -08:00
<Target Name="EnsureStageSeparation">
2017-02-27 11:06:44 -08:00
<DotNetMSBuild Arguments="/v:diag $(RepoRoot)/build_projects/Microsoft.DotNet.Cli.Build.SelfTest/InvokeWithStage0.proj /p:OutputDirectory="$(OutputDirectory)""
2017-01-27 00:56:51 -08:00
ToolPath="$(Stage0Directory)" />
2016-11-14 14:26:03 -08:00
</Target>
2016-12-13 14:15:35 -08:00
</Project>