using System;
using System.Collections.Generic;
using System.IO;
+using System.Text;
namespace Microsoft.DotNet.CoreSetup.Test
{
{
try
{
+ StringBuilder propsFile = new StringBuilder();
+
+ propsFile.AppendLine("<Project>");
+ propsFile.AppendLine(" <Import Project=\"$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), TestProjects.props))\\TestProjects.props\" />");
+ propsFile.AppendLine("</Project>");
+
// write an empty Directory.Build.props to ensure that msbuild doesn't pick up
// the repo's root Directory.Build.props.
- File.WriteAllText(directoryBuildPropsPath, "<Project></Project>");
+ File.WriteAllText(directoryBuildPropsPath, propsFile.ToString());
}
catch (IOException)
{}
</PropertyGroup>
<Target Name="Build" DependsOnTargets="$(BuildTestTargets)" />
-
+
<Target Name="DetermineTestOutputDirectory">
<GetTargetMachineInfo>
<Output TaskParameter="RuntimeIdentifier" PropertyName="_HostRid" />
<ItemGroup>
<DirsToClean Include="$(TestDir)\**\bin" />
<DirsToClean Include="$(TestDir)\**\obj" />
- <DirsToClean Include="$(TempFolderRoot)$(TargetArchitecture)" />
+ <DirsToClean Include="$(TempFolderRoot)$(TargetArchitecture)" />
</ItemGroup>
<RemoveDir Directories="@(DirsToClean)" />
<TestWorkingDirectory>$([System.IO.Path]::GetDirectoryName($(TestProject)))</TestWorkingDirectory>
<DirectorySeparatorChar>$([System.IO.Path]::DirectorySeparatorChar)</DirectorySeparatorChar>
<!-- The tests use the TEST_ARTIFACTS env variable to determine the artifacts folder and then later compare that path to its expected path.
- So, the TEST_ARTIFACTS variable has to have system specific path separators or the string compoarison will fail. -->
- <SystemPathTestsOutputDir>$([System.String]::Copy('$(TestsOutputDir)').Replace('/', '$(DirectorySeparatorChar)'))</SystemPathTestsOutputDir>
- <SystemPathTestsOutputDir>$([System.String]::Copy('$(SystemPathTestsOutputDir)').Replace('\', '$(DirectorySeparatorChar)'))</SystemPathTestsOutputDir>
+ So, the TEST_ARTIFACTS variable has to have system specific path separators or the string compoarison will fail. -->
+ <SystemPathTestsOutputDir>$([System.String]::Copy('$(TestsOutputDir)').Replace('/', '$(DirectorySeparatorChar)'))</SystemPathTestsOutputDir>
+ <SystemPathTestsOutputDir>$([System.String]::Copy('$(SystemPathTestsOutputDir)').Replace('\', '$(DirectorySeparatorChar)'))</SystemPathTestsOutputDir>
</PropertyGroup>
<PropertyGroup>
<TestArgs>--no-restore $(MSBuildPassThroughPropertyList)</TestArgs>
</FailedTests>
</ItemGroup>
<Message Importance="High" Condition="'@(FailedTests)' != ''" Text="Failed test summary" />
- <Message Importance="High" Condition="'@(FailedTests)' != ''" Text=" %(FailedTests.Identity) failed with exit code %(FailedTests.ExitCode), see %(FailedTests.ResultsXml)" />
+ <Message Importance="High" Condition="'@(FailedTests)' != ''" Text=" %(FailedTests.Identity) failed with exit code %(FailedTests.ExitCode), see %(FailedTests.ResultsXml)" />
<Error Condition="'@(FailedTests)' != ''" Text="One or more test runs failed." />
</Target>