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
<Target Name="Test"
Condition=" '$(CLIBUILD_SKIP_TESTS)' != 'true' "
2017-07-31 11:19:15 -07:00
DependsOnTargets="TestsForBuildItself;BuildTests;">
2016-08-09 15:19:34 -07:00
2017-08-09 22:30:20 -07:00
<!-- Make ure the test packages directory exists so that it's not an error to have it as a package source -->
<MakeDir Directories="$(TestPackagesDir)" />
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);
2017-08-09 22:30:20 -07:00
TestArtifactsDir=$(TestArtifactsDir);
TestPackagesDir=$(TestPackagesDir);
2017-08-11 07:09:01 -07:00
PreviousStageProps=$(NextStagePropsPath);
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-08-11 07:09:01 -07:00
ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln""
AdditionalParameters="/p:PreviousStageProps=$(NextStagePropsPath)" />
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""
2017-08-11 07:09:01 -07:00
AdditionalParameters="/p:PreviousStageProps=$(NextStagePropsPath)"
2017-02-28 19:30:43 -08:00
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-08-09 22:30:20 -07:00
ProjectPath="%(TestPackageProject.ProjectPath)"
2017-08-11 07:09:01 -07:00
AdditionalParameters="/p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages /p:PreviousStageProps=$(NextStagePropsPath)"
2017-08-09 22:30:20 -07:00
/>
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-08-11 07:09:01 -07:00
MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion) /p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages /p:PreviousStageProps=$(NextStagePropsPath)" />
2017-01-26 10:56:30 -08:00
2016-11-14 14:26:03 -08:00
</Target>
2017-01-27 00:45:59 -08:00
2017-07-31 11:19:15 -07:00
<Target Name="TestsForBuildItself">
<DotNetMSBuild Arguments="/v:diag $(RepoRoot)/test/MsBuildScript.Tests/runtests.target"
2017-08-11 16:13:43 -07:00
ToolPath="$(PreviousStageDirectory)" />
2017-07-31 11:19:15 -07: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-08-11 16:13:43 -07:00
ToolPath="$(PreviousStageDirectory)" />
2016-11-14 14:26:03 -08:00
</Target>
2016-12-13 14:15:35 -08:00
</Project>