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