Merge pull request #5759 from dotnet/dev/jgoshi/refactorTestTarget

Refactor properties out of test.targets
This commit is contained in:
Piotr Puszkiewicz 2017-02-22 10:56:42 -08:00 committed by GitHub
commit e2fbcefbbd
5 changed files with 32 additions and 41 deletions

View file

@ -4,5 +4,6 @@
<DotnetCliBuildDirectory>$(RepoRoot)/build_projects/dotnet-cli-build</DotnetCliBuildDirectory>
<MSBuildImportsDir>$(RepoRoot)/resources/MSBuildImports</MSBuildImportsDir>
<SrcDirectory>$(RepoRoot)/src</SrcDirectory>
<TestDirectory>$(RepoRoot)/test/</TestDirectory>
</PropertyGroup>
</Project>

View file

@ -19,5 +19,11 @@
<PackagesDirectory>$(BaseOutputDirectory)/packages</PackagesDirectory>
<SharedFrameworkPublishDirectory>$(IntermediateDirectory)/sharedFrameworkPublish</SharedFrameworkPublishDirectory>
<SharedFrameworkNameVersionPath>$(StageDirectory)/shared/$(SharedFrameworkName)/$(SharedFrameworkVersion)</SharedFrameworkNameVersionPath>
<DotnetUnderTest>$(Stage2Directory)</DotnetUnderTest>
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
<TestPackagesBuildDir>$(TestOutputDir)/packagesBuild/</TestPackagesBuildDir>
<TestPackagesDir>$(TestOutputDir)/packages/</TestPackagesDir>
<TestArtifactsDir>$(TestOutputDir)/artifacts/</TestArtifactsDir>
<TestResultXmlDir>$(TestOutputDir)/results/</TestResultXmlDir>
</PropertyGroup>
</Project>

View file

@ -1,33 +1,27 @@
<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" />
<PropertyGroup>
<PathListSeparator>:</PathListSeparator>
<PathListSeparator Condition=" '$(OSName)' == 'win' ">%3b</PathListSeparator>
<ExecPath>$(Stage2Directory)$(PathListSeparator)$(PATH)</ExecPath>
<ExecPath Condition=" '$(OSName)' == 'win' ">$(Stage2Directory)</ExecPath>
</PropertyGroup>
<ItemGroup>
<TestTaskEnvironmentVariables Include="PATH=$(ExecPath)" />
<TestTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsDir)" />
</ItemGroup>
<PropertyGroup>
<RunTestEnvironmentVariables>@(TestTaskEnvironmentVariables)</RunTestEnvironmentVariables>
</PropertyGroup>
<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>
@ -55,16 +49,6 @@
<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>

View file

@ -31,10 +31,10 @@
<Target Name="SetupBuildTestAssetProjectInputs">
<ItemGroup>
<NoAutoBuildTestAssets Include="TestAssets$(PathSeparator)TestProjects$(PathSeparator)**$(PathSeparator).noautobuild" />
<NoAutoBuildTestAssets Include="TestAssets/TestProjects/**/.noautobuild" />
<NoAutoBuildTestAssetProjects Include="%(NoAutoBuildTestAssets.RelativeDir)project.json" />
<PreTestAssetProjects Include="TestAssets$(PathSeparator)TestProjects$(PathSeparator)**$(PathSeparator)project.json"/>
<PreTestAssetProjects Include="TestAssets/TestProjects/**/project.json"/>
<TestAssetProjects Include="%(PreTestAssetProjects.RelativeDir)project.json"
Exclude="@(NoAutoBuildTestAssetProjects)"/>

View file

@ -10,20 +10,20 @@
<PreTestProjectsToExclude Condition=" '$(IsDesktopAvailable)' != 'True' "
Include="test/binding-redirects.Tests/binding-redirects.Tests.csproj;" />
-->
<PreTestProjectsToExclude Include="test$(PathSeparator)binding-redirects.Tests$(PathSeparator)binding-redirects.Tests.csproj;" />
<PreTestProjectsToExclude Include="test/binding-redirects.Tests/binding-redirects.Tests.csproj;" />
<PreTestProjectsToExclude Condition=" 'Non-test projects in test directory' != 'consider moving elsewhere' "
Include="test$(PathSeparator)ArgumentsReflector$(PathSeparator)ArgumentsReflector.csproj;
test$(PathSeparator)Microsoft.DotNet.Tools.Tests.Utilities$(PathSeparator)Microsoft.DotNet.Tools.Tests.Utilities.csproj;
test$(PathSeparator)Msbuild.Tests.Utilities$(PathSeparator)Msbuild.Tests.Utilities.csproj;
test$(PathSeparator)Performance$(PathSeparator)Performance.csproj" />
Include="test/ArgumentsReflector/ArgumentsReflector.csproj;
test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj;
test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj;
test/Performance/Performance.csproj" />
<PreTestProjectsToExclude Condition=" 'Executed after primary test phase.' != ' Consider moving.' "
Include="test$(PathSeparator)Installer$(PathSeparator)Microsoft.DotNet.Cli.Msi.Tests$(PathSeparator)Microsoft.DotNet.Cli.Msi.Tests.csproj;" />
Include="test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Microsoft.DotNet.Cli.Msi.Tests.csproj;" />
<TestProjectsToExclude Include="%(PreTestProjectsToExclude.Fullpath)" />
<PreTestProjects Include="test$(PathSeparator)*$(PathSeparator)*.csproj;" />
<PreTestProjects Include="test/*/*.csproj;" />
<TestProjects Include="%(PreTestProjects.Fullpath)"
Exclude="@(TestProjectsToExclude)" />