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
|
|
|
<Target Name="Test"
|
|
|
|
Condition=" '$(CLIBUILD_SKIP_TESTS)' != 'true' "
|
2017-07-31 18:19:15 +00:00
|
|
|
DependsOnTargets="TestsForBuildItself;BuildTests;">
|
2016-08-09 22:19:34 +00:00
|
|
|
|
2017-08-10 05:30:20 +00: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 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);
|
2017-08-10 05:30:20 +00:00
|
|
|
TestArtifactsDir=$(TestArtifactsDir);
|
|
|
|
TestPackagesDir=$(TestPackagesDir);
|
2017-08-11 14:09:01 +00:00
|
|
|
PreviousStageProps=$(NextStagePropsPath);
|
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-08-11 14:09:01 +00:00
|
|
|
ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln""
|
|
|
|
AdditionalParameters="/p:PreviousStageProps=$(NextStagePropsPath)" />
|
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-03-01 03:30:43 +00:00
|
|
|
ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln""
|
2017-08-11 14:09:01 +00:00
|
|
|
AdditionalParameters="/p:PreviousStageProps=$(NextStagePropsPath)"
|
2017-03-01 03:30:43 +00:00
|
|
|
MaxCpuCount="1" />
|
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-08-10 05:30:20 +00:00
|
|
|
ProjectPath="%(TestPackageProject.ProjectPath)"
|
2017-08-11 14:09:01 +00:00
|
|
|
AdditionalParameters="/p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages /p:PreviousStageProps=$(NextStagePropsPath)"
|
2017-08-10 05:30:20 +00:00
|
|
|
/>
|
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-08-11 14:09:01 +00:00
|
|
|
MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion) /p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages /p:PreviousStageProps=$(NextStagePropsPath)" />
|
2017-01-26 18:56:30 +00:00
|
|
|
|
2016-11-14 22:26:03 +00:00
|
|
|
</Target>
|
2017-01-27 08:45:59 +00:00
|
|
|
|
2017-07-31 18:19:15 +00:00
|
|
|
<Target Name="TestsForBuildItself">
|
|
|
|
<DotNetMSBuild Arguments="/v:diag $(RepoRoot)/test/MsBuildScript.Tests/runtests.target"
|
2017-08-11 23:13:43 +00:00
|
|
|
ToolPath="$(PreviousStageDirectory)" />
|
2017-07-31 18:19:15 +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-08-11 23:13:43 +00:00
|
|
|
ToolPath="$(PreviousStageDirectory)" />
|
2016-11-14 22:26:03 +00:00
|
|
|
</Target>
|
2016-12-13 22:15:35 +00:00
|
|
|
</Project>
|