2017-01-22 14:40:00 -08:00
<Project ToolsVersion="14.0" DefaultTargets="Test">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
2016-07-15 00:20:23 -07:00
<PropertyGroup>
<PathSeparator>/</PathSeparator>
<PathSeparator Condition=" '$(OSName)' == 'win' ">\</PathSeparator>
</PropertyGroup>
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
2016-08-09 15:19:34 -07:00
<Target Name="Test"
2016-12-05 13:36:35 -08:00
Condition=" '$(CLIBUILD_SKIP_TESTS)' != 'true' "
2017-01-22 14:40:00 -08:00
DependsOnTargets="BuildTests;">
2016-11-11 21:46:29 -10:00
2016-07-11 12:46:27 -07:00
<PropertyGroup>
<PathListSeparator>:</PathListSeparator>
<PathListSeparator Condition=" '$(OSName)' == 'win' ">%3b</PathListSeparator>
<ExecPath>$(Stage2Directory)$(PathListSeparator)$(PATH)</ExecPath>
<ExecPath Condition=" '$(OSName)' == 'win' ">$(Stage2Directory)</ExecPath>
<TestArtifactsEnv>$(TestArtifactsDir)</TestArtifactsEnv>
</PropertyGroup>
<ItemGroup>
<TestTaskEnvironmentVariables Include="PATH=$(ExecPath)" />
<TestTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsEnv)" />
</ItemGroup>
2016-08-09 15:19:34 -07:00
<PropertyGroup>
<RunTestEnvironmentVariables>@(TestTaskEnvironmentVariables)</RunTestEnvironmentVariables>
</PropertyGroup>
<ItemGroup>
<ProjectsToTest Include="build/test/RunTest.proj">
<Properties>
2017-01-11 01:49:22 -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-01-23 11:51:30 -08:00
ToolPath=$(Stage2Directory);
2017-01-22 14:40:00 -08:00
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">
2016-07-11 12:46:27 -07:00
<PropertyGroup>
<TestPackageBuildVersionSuffix>$(CommitCount)</TestPackageBuildVersionSuffix>
2016-10-27 18:46:43 -07:00
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
2016-07-12 17:10:48 -07:00
<TestPackagesBuildDir>$(TestOutputDir)/packagesBuild/</TestPackagesBuildDir>
<TestPackagesDir>$(TestOutputDir)/packages/</TestPackagesDir>
<TestArtifactsDir>$(TestOutputDir)/artifacts/</TestArtifactsDir>
<TestResultXmlDir>$(TestOutputDir)/results/</TestResultXmlDir>
<TestDirectory>$(RepoRoot)/test/</TestDirectory>
<DotnetUnderTest>$(Stage2Directory)</DotnetUnderTest>
2016-07-11 12:46:27 -07:00
</PropertyGroup>
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-01-18 12:04:18 -08:00
<DotNetRestore ToolPath="$(Stage0Directory)"
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;">
<DotNetBuild ToolPath="$(Stage0Directory)"
ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln"" />
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;"
2016-07-12 17:10:48 -07:00
Inputs="%(TestPackageProject.PackInputs)"
Outputs="%(TestPackageProject.PackOutputs)">
2016-07-11 12:46:27 -07:00
2016-11-15 12:12:28 -10:00
<PropertyGroup>
2017-01-10 14:12:04 -08:00
<Framework>%(TestPackageProject.Framework)</Framework>
<DoPackRuntime Condition=" '$(Framework)' == 'net45' Or '$(Framework)' == 'net451' ">true</DoPackRuntime>
<DotNetPackMsbuildArgs>/p:TargetFramework=$(Framework)</DotNetPackMsbuildArgs>
<DotNetPackMsbuildArgs Condition=" '$(IsDesktopAvailable)' == 'True' And '%(TestPackageProject.PackRuntime)' != '' And '$(DoPackRuntime)' != '' ">/p:RuntimeIdentifier=%(TestPackageProject.PackRuntime)</DotNetPackMsbuildArgs>
2016-11-15 12:12:28 -10:00
</PropertyGroup>
2017-01-09 16:49:57 -08:00
2017-01-10 10:47:10 -08:00
<DotNetRestore ToolPath="$(Stage2Directory)"
2017-01-09 16:49:57 -08:00
Source="$(TestPackagesDir)"
2017-01-10 10:43:05 -08:00
ConfigFile="$(RepoRoot)\NuGet.Config"
ProjectPath="%(TestPackageProject.ProjectPath)" />
2017-01-09 16:49:57 -08:00
2017-01-10 14:12:04 -08:00
<DotNetBuild Framework="$(Framework)"
2017-01-09 16:49:57 -08:00
Runtime="%(TestPackageProject.Runtime)"
ProjectPath="%(TestPackageProject.ProjectPath)"
ToolPath="$(Stage0Directory)" />
2016-11-15 12:12:28 -10:00
2016-12-09 00:30:02 -08:00
<!-- https://github.com/NuGet/Home/issues/4063 -->
2016-11-15 12:12:28 -10:00
<DotNetPack NoBuild="True"
2016-11-14 14:26:03 -08:00
Output="$(TestPackagesDir)"
2016-11-15 12:12:28 -10:00
ProjectPath="%(TestPackageProject.ProjectPath)"
ToolPath="$(Stage0Directory)"
VersionSuffix="%(TestPackageProject.VersionSuffix)"
2016-12-09 00:30:02 -08:00
MsbuildArgs="$(DotNetPackMsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion)" />
2016-11-14 14:26:03 -08:00
</Target>
2016-12-13 14:15:35 -08:00
</Project>