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