85b2a129db
Conflicts: TestAssets/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.csproj TestAssets/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.csproj TestAssets/TestPackages/dotnet-prefercliruntime/dotnet-prefercliruntime.csproj TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj build.proj build/Compile.targets build/Microsoft.DotNet.Cli.Compile.targets build/Microsoft.DotNet.Cli.DependencyVersions.props build/Microsoft.DotNet.Cli.Monikers.props build/Microsoft.DotNet.Cli.Prepare.targets build/package/Microsoft.DotNet.Cli.Nupkg.targets build/package/Nupkg.targets build/test/TestPackageProjects.targets build_projects/dotnet-cli-build/GenerateBuildVersionInfo.cs build_projects/dotnet-cli-build/GetCommitCount.cs build_projects/dotnet-cli-build/dotnet-cli-build.csproj build_projects/shared-build-targets-utils/Utils/BuildVersion.cs src/dotnet-archive/dotnet-archive.csproj src/tool_msbuild/tool_msbuild.csproj src/tool_nuget/tool_nuget.csproj test/ArgumentForwardingTests/ArgumentForwardingTests.csproj test/ArgumentsReflector/ArgumentsReflector.csproj test/EndToEnd/EndToEnd.csproj test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj test/Microsoft.DotNet.ProjectJsonMigration.Tests/Microsoft.DotNet.ProjectJsonMigration.Tests.csproj test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj test/binding-redirects.Tests/binding-redirects.Tests.csproj test/crossgen.Tests/crossgen.Tests.csproj test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj test/dotnet-build.Tests/dotnet-build.Tests.csproj test/dotnet-help.Tests/dotnet-help.Tests.csproj test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj test/dotnet-new.Tests/dotnet-new.Tests.csproj test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj test/dotnet-pack.Tests/dotnet-pack.Tests.csproj test/dotnet-publish.Tests/dotnet-publish.Tests.csproj test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj test/dotnet-restore.Tests/dotnet-restore.Tests.csproj test/dotnet-run.Tests/dotnet-run.Tests.csproj test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj test/dotnet-test.Tests/dotnet-test.Tests.csproj test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj test/dotnet.Tests/dotnet.Tests.csproj test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj tools/Archiver/Archiver.csproj
106 lines
4.2 KiB
XML
106 lines
4.2 KiB
XML
<Project ToolsVersion="14.0" DefaultTargets="Test">
|
|
<PropertyGroup>
|
|
<PathSeparator>/</PathSeparator>
|
|
<PathSeparator Condition=" '$(OSName)' == 'win' ">\</PathSeparator>
|
|
</PropertyGroup>
|
|
|
|
<Import Project="test/TestPackageProjects.targets" />
|
|
<Import Project="test/TestProjects.targets" />
|
|
|
|
<Target Name="Test"
|
|
Condition=" '$(CLIBUILD_SKIP_TESTS)' != 'true' "
|
|
DependsOnTargets="BuildTests;">
|
|
|
|
<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>
|
|
|
|
<PropertyGroup>
|
|
<RunTestEnvironmentVariables>@(TestTaskEnvironmentVariables)</RunTestEnvironmentVariables>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<ProjectsToTest Include="build/test/RunTest.proj">
|
|
<Properties>
|
|
CLIBuildDll=$(CLIBuildDll);
|
|
Configuration=$(Configuration);
|
|
EnvironmentVariables=$(RunTestEnvironmentVariables);
|
|
TestProject=%(TestProjects.Identity);
|
|
TestResultXmlDir=$(TestResultXmlDir);
|
|
ToolPath=$(Stage2Directory);
|
|
WorkingDirectory=$([System.IO.Directory]::GetParent(%(TestProjects.Identity)))
|
|
</Properties>
|
|
</ProjectsToTest>
|
|
</ItemGroup>
|
|
|
|
<Message Text="Starting test execution" Importance="High" />
|
|
|
|
<MSBuild
|
|
BuildInParallel="True"
|
|
Projects="@(ProjectsToTest)">
|
|
</MSBuild>
|
|
|
|
<Message Text="Finished test execution" Importance="High" />
|
|
</Target>
|
|
|
|
<Target Name="PrepareTests"
|
|
DependsOnTargets="Init;
|
|
SetupTestProjectData">
|
|
<PropertyGroup>
|
|
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
|
|
<TestPackagesBuildDir>$(TestOutputDir)/packagesBuild/</TestPackagesBuildDir>
|
|
<TestPackagesDir>$(TestOutputDir)/packages/</TestPackagesDir>
|
|
<TestArtifactsDir>$(TestOutputDir)/artifacts/</TestArtifactsDir>
|
|
<TestResultXmlDir>$(TestOutputDir)/results/</TestResultXmlDir>
|
|
<TestDirectory>$(RepoRoot)/test/</TestDirectory>
|
|
<DotnetUnderTest>$(Stage2Directory)</DotnetUnderTest>
|
|
</PropertyGroup>
|
|
|
|
<MakeDir Directories="$(TestPackagesDir)" Condition="!Exists('$(TestPackagesDir)')"/>
|
|
</Target>
|
|
|
|
<Target Name="RestoreTests"
|
|
DependsOnTargets="PrepareTests;
|
|
CreateTestAssetPackageNuPkgs;">
|
|
<DotNetRestore ToolPath="$(Stage0Directory)"
|
|
ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln"" />
|
|
</Target>
|
|
|
|
<Target Name="BuildTests"
|
|
DependsOnTargets="RestoreTests;">
|
|
<DotNetBuild ToolPath="$(Stage0Directory)"
|
|
ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln""
|
|
MaxCpuCount="1" />
|
|
</Target>
|
|
|
|
<Target Name="CreateTestAssetPackageNuPkgs"
|
|
DependsOnTargets="SetupTestPackageProjectData;"
|
|
Outputs="%(TestPackageProject.Identity)">
|
|
|
|
<DotNetRestore ToolPath="$(Stage2Directory)"
|
|
WorkingDirectory="$([System.IO.Directory]::GetParent('%(TestPackageProject.ProjectPath)'))"
|
|
ProjectPath="%(TestPackageProject.ProjectPath)" />
|
|
|
|
<!-- https://github.com/NuGet/Home/issues/4063 -->
|
|
<DotNetPack Output="$(TestPackagesDir)"
|
|
ProjectPath="%(TestPackageProject.ProjectPath)"
|
|
ToolPath="$(Stage0Directory)"
|
|
VersionSuffix="%(TestPackageProject.VersionSuffix)"
|
|
MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion)" />
|
|
|
|
</Target>
|
|
|
|
<Target Name="EnsureStageSeparation">
|
|
<DotNetMSBuild Arguments="/v:diag $(RepoRoot)/build_projects/Microsoft.DotNet.Cli.Build.SelfTest/InvokeWithStage0.proj /p:Stage2Directory="$(Stage2Directory)""
|
|
ToolPath="$(Stage0Directory)" />
|
|
</Target>
|
|
</Project>
|