509 строки
24 KiB
XML
509 строки
24 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
<Import Project="src\dir.props" />
|
|
<Import Project="$(ToolsDir)Build.Post.targets" Condition="Exists('$(ToolsDir)Build.Post.targets') AND '$(BuildWrappers)' == 'true'" />
|
|
<Import Project="helixperftasks.targets" Condition="'$(Performance)'=='true'"/>
|
|
<PropertyGroup>
|
|
<XunitTestBinBase Condition="'$(XunitTestBinBase)'==''" >$(BaseOutputPathWithConfig)</XunitTestBinBase>
|
|
<XunitWrapperGeneratedCSDirBase>$(XunitTestBinBase)\TestWrappers\</XunitWrapperGeneratedCSDirBase>
|
|
<MSBuildEnableAllPropertyFunctions>1</MSBuildEnableAllPropertyFunctions>
|
|
</PropertyGroup>
|
|
|
|
<!-- TestHost destinations -->
|
|
<PropertyGroup>
|
|
<NETCoreAppTestSharedFxVersion>9.9.9</NETCoreAppTestSharedFxVersion>
|
|
<TestHostRootPath>$(BinDir)testhost\</TestHostRootPath>
|
|
<NETCoreAppTestHostFxrPath>$(TestHostRootPath)host\fxr\$(NETCoreAppTestSharedFxVersion)\</NETCoreAppTestHostFxrPath>
|
|
<NETCoreAppTestSharedFrameworkPath>$(TestHostRootPath)shared\Microsoft.NETCore.App\$(NETCoreAppTestSharedFxVersion)\</NETCoreAppTestSharedFrameworkPath>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<DisabledTestDir Include="Common" />
|
|
<_SkipTestDir Include="@(DisabledTestDir)" />
|
|
</ItemGroup>
|
|
|
|
<Target Name="Rebuild" />
|
|
|
|
<Target Name="FindCmdDirectories" DependsOnTargets="GetListOfTestCmds">
|
|
|
|
<Error Condition="!Exists('$(XunitTestBinBase)')"
|
|
Text="$(XunitTestBinBase) does not exist. Please run build-test.cmd from the repo root at least once to get the tests built." />
|
|
|
|
<ItemGroup>
|
|
|
|
<AllTestDirsNonCanonicalPaths Include="$([System.IO.Directory]::GetDirectories(`$(XunitTestBinBase)`))" />
|
|
<AllTestDirsPaths Include="@(AllTestDirsNonCanonicalPaths)" />
|
|
<AllTestDirsPaths Include="@(AllTestDirsNonCanonicalPaths)" >
|
|
<Path>$([System.IO.Path]::GetFullPath(%(Identity)))</Path>
|
|
</AllTestDirsPaths>
|
|
<NonExcludedTestDirectories Include="@(AllTestDirsPaths -> '%(Path)')" Exclude="@(_SkipTestDir -> '$(XunitTestBinBase)%(Identity)')" />
|
|
<TopLevelDirectories Include="@(NonExcludedTestDirectories)" />
|
|
<SecondLevel Include="$([System.IO.Directory]::GetDirectories(%(TopLevelDirectories.Identity)))" />
|
|
<SecondLevelDirectories Include="@(SecondLevel)">
|
|
<Path>$([System.IO.Path]::GetFullPath(%(AllRunnableTestPaths.Identity)))</Path>
|
|
</SecondLevelDirectories>
|
|
<TestDirectoriesWithDup Include="@(SecondLevelDirectories -> '%(Identity)')" Condition="$([System.String]::new('%(Path)').StartsWith('%(Identity)'))" />
|
|
|
|
</ItemGroup>
|
|
|
|
<RemoveDuplicates Inputs="@(TestDirectoriesWithDup)">
|
|
<Output
|
|
TaskParameter="Filtered"
|
|
ItemName="TestDirectories"/>
|
|
</RemoveDuplicates>
|
|
|
|
</Target>
|
|
|
|
<!-- Target to check the test build, to see if it looks ok. We've had several cases where a change inadvertently and drastically changes
|
|
the set of tests that are built, and that change is unnoticed. The most common case is for a build of the Priority 1 tests
|
|
to only build the Priority 0 tests. This target is run after a test build to verify that the basic number of tests that were
|
|
built is basically what was expected. When this was written, there were about 2500 Priority 0 tests and about 10268 Priority 1
|
|
tests on Windows, 9976 on Ubuntu (it differs slightly based on platform). We currently check that the number of Priority 0 tests
|
|
is greater than 2000 and less than 3000, and the number of Priority 1 tests is greater than 9000.
|
|
-->
|
|
<Target Name="CheckTestBuild" DependsOnTargets="GetListOfTestCmds">
|
|
<Error Condition="!Exists('$(XunitTestBinBase)')"
|
|
Text="$(XunitTestBinBase) does not exist. Please run build-test.cmd from the repo root at least once to get the tests built." />
|
|
|
|
<PropertyGroup>
|
|
<TestCount>@(AllRunnableTestPaths->Count())</TestCount>
|
|
</PropertyGroup>
|
|
|
|
<Message Text="Found $(TestCount) built tests"/>
|
|
|
|
<Error Condition="'$(CLRTestPriorityToBuild)' == '0' and '$(TestCount)' <= 2000" Text="Unexpected test count. Expected > 2000, found $(TestCount).'" />
|
|
<Error Condition="'$(CLRTestPriorityToBuild)' == '0' and '$(TestCount)' >= 3000" Text="Unexpected test count. Expected < 3000, found $(TestCount).'" />
|
|
<Error Condition="'$(CLRTestPriorityToBuild)' == '1' and '$(TestCount)' <= 9000" Text="Unexpected test count. Expected > 9000, found $(TestCount).'" />
|
|
<Error Condition="'$(CLRTestPriorityToBuild)' != '0' and '$(CLRTestPriorityToBuild)' != '1'" Text="Unknown priority $(CLRTestPriorityToBuild)" />
|
|
</Target>
|
|
|
|
<Import Project="$(__Exclude)" Condition="'$(__Exclude)' != '' AND '$(XunitTestBinBase)' != ''" />
|
|
<PropertyGroup>
|
|
<HaveExcludes>False</HaveExcludes>
|
|
<HaveExcludes Condition="'$(__Exclude)' != ''">True</HaveExcludes>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="CreateXunitWrapper" DependsOnTargets="CreateXunitFacts">
|
|
|
|
<PropertyGroup>
|
|
<_XunitWrapperGen >
|
|
<![CDATA[
|
|
|
|
$(_XunitProlog)
|
|
@(AllXUnitFacts)
|
|
$(_XunitEpilog)
|
|
|
|
]]>
|
|
</_XunitWrapperGen>
|
|
<XunitWrapperGenCsProj>
|
|
<![CDATA[
|
|
<Project>
|
|
|
|
<Import Project="$(ProjectDir)dir.sdkbuild.props" />
|
|
|
|
<PropertyGroup>
|
|
<OutputPath>$(XUnitTestBinBase)\$(CategoryWithSlash)</OutputPath>
|
|
<RuntimeFrameworkVersion>$(MicrosoftNETCoreAppPackageVersion)</RuntimeFrameworkVersion>
|
|
</PropertyGroup>
|
|
|
|
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
|
|
|
|
<ItemGroup>
|
|
<Compile Include="$(XunitWrapper).cs" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<ProjectReference Include="$(SourceDir)Common\Coreclr.TestWrapper\Coreclr.TestWrapper.csproj" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<PackageReference Include="xunit" Version="$(XunitPackageVersion)" />
|
|
<PackageReference Include="xunit.runner.console" Version="$(XunitPackageVersion)" />
|
|
</ItemGroup>
|
|
|
|
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
|
|
|
|
</Project>
|
|
]]>
|
|
</XunitWrapperGenCsProj>
|
|
</PropertyGroup>
|
|
|
|
<!-- <Exec Command="md" -->
|
|
<MakeDir Directories="$(XunitWrapperGeneratedCSDirBase)$(Category)"/>
|
|
|
|
<!-- Write the file -->
|
|
<WriteLinesToFile
|
|
File="$(XunitWrapperSrcDir)\$(XunitWrapper).cs"
|
|
Lines="$(_XunitWrapperGen)"
|
|
Overwrite="true" />
|
|
|
|
<!-- Write the file -->
|
|
<WriteLinesToFile
|
|
File="$(XunitWrapperSrcDir)\$(XunitWrapper).csproj"
|
|
Lines="$(XunitWrapperGenCsProj)"
|
|
Overwrite="true" />
|
|
</Target>
|
|
|
|
<Target Name="BuildXunitWrapper">
|
|
<MSBuild Projects="$(XunitWrapperSrcDir)\$(XunitWrapper).csproj" Targets="Restore;Build" />
|
|
</Target>
|
|
|
|
<Target Name="CreateXunitFacts">
|
|
<!-- NOTE! semicolons must be escaped with %3B boooo -->
|
|
|
|
<PropertyGroup>
|
|
<_CMDDIR_Parent>$([System.IO.Path]::GetDirectoryName($(_CMDDIR)))</_CMDDIR_Parent>
|
|
<_CMDDIR_Grandparent>$([System.IO.Path]::GetDirectoryName($(_CMDDIR_Parent)))</_CMDDIR_Grandparent>
|
|
<CategoryWithSlash Condition="'$(RunningOnUnix)' != 'true'" >$([System.String]::Copy('$(_CMDDIR)').Replace("$(_CMDDIR_Grandparent)\",""))</CategoryWithSlash>
|
|
<CategoryWithSlash Condition="'$(RunningOnUnix)' == 'true'" >$([System.String]::Copy('$(_CMDDIR)').Replace("$(_CMDDIR_Grandparent)/",""))</CategoryWithSlash>
|
|
<Category Condition="'$(RunningOnUnix)' != 'true'" >$([System.String]::Copy('$(CategoryWithSlash)').Replace('\','.'))</Category>
|
|
<Category Condition="'$(RunningOnUnix)' == 'true'" >$([System.String]::Copy('$(CategoryWithSlash)').Replace('/','.'))</Category>
|
|
<XunitWrapper>$(Category).XUnitWrapper</XunitWrapper>
|
|
<XunitWrapperSrcDir>$(XunitWrapperGeneratedCSDirBase)$(Category)</XunitWrapperSrcDir>
|
|
</PropertyGroup>
|
|
<PropertyGroup>
|
|
<_XunitProlog Condition=" '$(_XunitProlog)'=='' ">
|
|
<![CDATA[
|
|
using Xunit%3B
|
|
using System%3B
|
|
using System.Collections.Generic%3B
|
|
using System.Diagnostics%3B
|
|
using System.Reflection%3B
|
|
using CoreclrTestLib%3B
|
|
|
|
namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").Replace("-","_"))
|
|
{
|
|
internal class _Global
|
|
{
|
|
internal static bool runningInWindows%3B
|
|
internal static string reportBase%3B
|
|
internal static string testBinaryBase%3B
|
|
internal static string coreRoot%3B
|
|
|
|
static _Global()
|
|
{
|
|
reportBase = System.Environment.GetEnvironmentVariable(%22XunitTestReportDirBase%22)%3B
|
|
testBinaryBase = System.IO.Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath)%3B
|
|
coreRoot = System.Environment.GetEnvironmentVariable(%22CORE_ROOT%22)%3B
|
|
|
|
if (String.IsNullOrEmpty(reportBase)) {
|
|
reportBase = System.IO.Path.Combine(testBinaryBase, "Reports")%3B
|
|
}
|
|
else
|
|
{
|
|
reportBase = System.IO.Path.GetFullPath(reportBase)%3B
|
|
}
|
|
|
|
if (String.IsNullOrEmpty(coreRoot)) {
|
|
throw new ArgumentException("Environment variable CORE_ROOT is not set")%3B
|
|
}
|
|
|
|
coreRoot = System.IO.Path.GetFullPath(coreRoot)%3B
|
|
|
|
string operatingSystem = System.Environment.GetEnvironmentVariable("OS")%3B
|
|
runningInWindows = (operatingSystem != null && operatingSystem.StartsWith("Windows"))%3B
|
|
}
|
|
}
|
|
|
|
]]>
|
|
</_XunitProlog>
|
|
|
|
<_XunitEpilog Condition=" '$(_XunitEpilog)'=='' ">
|
|
<![CDATA[
|
|
}
|
|
|
|
]]>
|
|
</_XunitEpilog>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<CanonicalExcludeList Include="%(ExcludeList.FullPath)" Condition="$(HaveExcludes)"/>
|
|
<CanonicalIncludeList Include="%(IncludeList.FullPath)" Condition="$(HaveExcludes)"/>
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup>
|
|
<TestExecutableReplacement Condition="'$(TargetsWindows)' != 'true' ">testExecutable = testExecutable.Replace("\\", "/")%3B</TestExecutableReplacement>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<AllCMDsPresent Include="$(_CMDDIR)\**\*.cmd" Condition="'$(RunningOnUnix)' != 'true' AND '@(CanonicalIncludeList)' == ''" />
|
|
<AllCMDsPresent Condition="'$(RunningOnUnix)' != 'true' AND '@(CanonicalIncludeList)' != '' AND $([System.IO.Path]::GetFullPath(%(CanonicalIncludeList.FullPath)).StartsWith('$(_CMDDIR)')) == 'true' AND $([System.IO.Path]::GetFullPath(%(CanonicalIncludeList.FullPath)).EndsWith('.cmd')) == 'true'" Include="$([System.IO.Path]::GetFullPath(%(CanonicalIncludeList.FullPath)))" />
|
|
<AllCMDsPresent Include="$(_CMDDIR)\**\*.sh" Condition="'$(RunningOnUnix)' == 'true' AND '@(CanonicalIncludeList)' == ''" />
|
|
<AllCMDsPresent Condition="'$(RunningOnUnix)' == 'true' AND '@(CanonicalIncludeList)' != '' AND $([System.IO.Path]::GetFullPath(%(CanonicalIncludeList.FullPath)).StartsWith('$(_CMDDIR)')) == 'true' AND $([System.IO.Path]::GetFullPath(%(CanonicalIncludeList.FullPath)).EndsWith('.sh')) == 'true'" Include="$([System.IO.Path]::GetFullPath(%(CanonicalIncludeList.FullPath)))" />
|
|
<AllCMDExcludeFilter Include="@(CanonicalExcludeList)" Condition="$(HaveExcludes)"/>
|
|
<AllCMDs Include="@(AllCMDsPresent)" Exclude="@(AllCMDExcludeFilter)"/>
|
|
|
|
<AllCommands Include="@(AllCMDs)" >
|
|
<_FactName Condition="'$(RunningOnUnix)' != 'true'" >$([System.String]::Copy('%(AllCMDs.FullPath)').Replace("$(_CMDDIR)",'').Replace(".","_").Replace("\","_").Replace("-","_"))</_FactName>
|
|
<_ClassName Condition="'$(RunningOnUnix)' != 'true'" >$([System.String]::Copy('%(AllCMDs.FullPath)').Replace("$(_CMDDIR)",'').Replace("cmd","").Replace(".","_").Replace("\","_").Replace("-","_"))</_ClassName>
|
|
<_FactName Condition="'$(RunningOnUnix)' == 'true'" >$([System.String]::Copy('%(AllCMDs.FullPath)').Replace("$(_CMDDIR)",'').Replace(".","_").Replace("/","_").Replace("-","_"))</_FactName>
|
|
<_ClassName Condition="'$(RunningOnUnix)' == 'true'" >$([System.String]::Copy('%(AllCMDs.FullPath)').Replace("$(_CMDDIR)",'').Replace("sh","").Replace(".","_").Replace("/","_").Replace("-","_"))</_ClassName>
|
|
|
|
<_XunitFact >
|
|
<![CDATA[
|
|
|
|
public class %(AllCommands._ClassName)
|
|
{
|
|
[Fact]
|
|
public void %(AllCommands._FactName)()
|
|
{
|
|
int ret = -100%3B
|
|
string outputFile = null%3B
|
|
string errorFile = null%3B
|
|
string testExecutable = null%3B
|
|
Exception infraEx = null%3B
|
|
|
|
try
|
|
{
|
|
CoreclrTestWrapperLib wrapper = new CoreclrTestWrapperLib()%3B
|
|
string testSubfolder = @"\$(Category)\$([System.String]::Copy('%(AllCMDs.RelativeDir)').Replace("$(_CMDDIR)$([System.IO.Path]::DirectorySeparatorChar)",''))"%3B
|
|
outputFile = System.IO.Path.GetFullPath(_Global.reportBase + testSubfolder + @"%(AllCMDs.FileName).output.txt")%3B
|
|
errorFile = System.IO.Path.GetFullPath(_Global.reportBase + testSubfolder + @"%(AllCMDs.FileName).error.txt")%3B
|
|
testExecutable = System.IO.Path.GetFullPath(_Global.testBinaryBase + @"$([System.String]::Copy('%(AllCMDs.FullPath)').Replace("$(_CMDDIR)",''))")%3B
|
|
$(TestExecutableReplacement)
|
|
|
|
if (!_Global.runningInWindows) {
|
|
testExecutable = testExecutable.Replace(".cmd", ".sh")%3B
|
|
}
|
|
|
|
System.IO.Directory.CreateDirectory(_Global.reportBase + testSubfolder)%3B
|
|
|
|
ret = wrapper.RunTest(testExecutable, outputFile, errorFile)%3B
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
infraEx = ex%3B
|
|
}
|
|
|
|
if (ret != CoreclrTestWrapperLib.EXIT_SUCCESS_CODE)
|
|
{
|
|
string sErrorText = null%3B
|
|
try
|
|
{
|
|
sErrorText = System.IO.File.ReadAllText(errorFile)%3B
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
sErrorText = $"Unable to read error file: {errorFile}\n{ex}"%3B
|
|
}
|
|
|
|
string outputText = null%3B
|
|
try
|
|
{
|
|
System.IO.StreamReader outputReader = new System.IO.StreamReader(outputFile)%3B
|
|
outputText = outputReader.ReadToEnd()%3B
|
|
outputReader.Close()%3B
|
|
}
|
|
catch(Exception ex)
|
|
{
|
|
outputText = $"Unable to read error file: {outputFile}\n{ex}"%3B
|
|
}
|
|
|
|
string msg = infraEx != null ? "Test Infrastructure Failure: " + infraEx.ToString()
|
|
: sErrorText + "\n\n" +
|
|
"Return code: " + ret + "\n" +
|
|
"Raw output file: " + outputFile + "\n" +
|
|
"Raw output:\n" + outputText + "\n" +
|
|
"To run the test:\n" +
|
|
"> set CORE_ROOT=" + _Global.coreRoot + "\n" +
|
|
"> " + testExecutable + "\n"%3B
|
|
|
|
Assert.True(ret == CoreclrTestWrapperLib.EXIT_SUCCESS_CODE, msg)%3B
|
|
}
|
|
}
|
|
}
|
|
|
|
]]>
|
|
</_XunitFact>
|
|
</AllCommands>
|
|
<AllXUnitFacts Include= "%(AllCommands._XunitFact)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="CreateAllWrappers" DependsOnTargets="GetListOfTestCmds;FindCmdDirectories">
|
|
<MSBuild Projects="$(MSBuildProjectFile)" Targets="CreateXunitWrapper;BuildXunitWrapper" Properties="_CMDDIR=%(TestDirectories.Identity)" />
|
|
</Target>
|
|
|
|
<Target Name="GetListOfTestCmds">
|
|
<ItemGroup>
|
|
<AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.cmd" Condition="'$(BuildOS)' == 'Windows_NT'" />
|
|
<AllRunnableTestPaths Include="$(XunitTestBinBase)\**\*.sh" Condition="'$(BuildOS)' != 'Windows_NT'" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<!-- If we want to overwrite the desired CoreCLR package version, we need to get the new version from the generated props file in bin/obj -->
|
|
<Import Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'" Project="$(BuildVersionFile)" />
|
|
|
|
<PropertyGroup Condition="'$(OverwriteCoreClrPackageVersion)' == 'true'">
|
|
<VersionToRestore Condition="'$(StableVersion)' != ''">$(StableVersion)</VersionToRestore>
|
|
<VersionToRestore Condition="'$(VersionToRestore)' == ''">$(PackageVersion)-$(PreReleaseLabel)-$(BuildNumberMajor)-$(BuildNumberMinor)</VersionToRestore>
|
|
<DesiredPackageVersionArg>$(VersionToRestore)</DesiredPackageVersionArg>
|
|
</PropertyGroup>
|
|
|
|
<Import Project="tests.targets" />
|
|
<Import Project="publishdependency.targets" />
|
|
|
|
<PropertyGroup>
|
|
<DesiredPackageVersionArg Condition="'$(DesiredPackageVersionArg)' == ''">$(MicrosoftNETCoreRuntimeCoreCLRPackageVersion)</DesiredPackageVersionArg>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="CreateTestOverlay">
|
|
<MSBuild Projects="$(MSBuildProjectFile)"
|
|
Targets="CopyDependencyToCoreRoot"
|
|
Properties="Language=C#;TargetRid=$(TargetRid)" />
|
|
</Target>
|
|
|
|
<Target Name="BinPlaceRef">
|
|
<!-- Copy mscorlib.dll from TargetingPack to bin/Product/ref, if we're building against packages -->
|
|
<MSBuild Projects="$(MSBuildProjectFile)"
|
|
Targets="CopyDependencyToRef"
|
|
Properties="Language=C#;TargetRid=$(TargetRid)"
|
|
Condition=" '$(BuildTestsAgainstPackages)'=='true' " />
|
|
</Target>
|
|
|
|
<Target Name="BinPlaceProduct">
|
|
<!-- Copy test dependencies to bin/Product, if we're building against packages -->
|
|
<MSBuild Projects="$(MSBuildProjectFile)"
|
|
Targets="CopyDependencyToProduct"
|
|
Properties="Language=C#;TargetRid=$(TargetRid)"
|
|
Condition=" '$(BuildTestsAgainstPackages)'=='true' " />
|
|
</Target>
|
|
|
|
<Target Name="ResolveTestHostDependencies">
|
|
<MSBuild Projects="$(MSBuildThisFileDirectory)src\Common\CoreFX\CoreFX.depproj"
|
|
Properties="OutputPath=$(NETCoreAppTestSharedFrameworkPath);" />
|
|
</Target>
|
|
|
|
<Target Name="CreateTestHost" DependsOnTargets="ResolveTestHostDependencies">
|
|
<MSBuild Projects="$(MSBuildProjectFile)"
|
|
Targets="SetupTestingHost"/>
|
|
|
|
<MSBuild Projects="$(MSBuildProjectFile)"
|
|
Targets="GenerateTestSharedFrameworkDepsFile"/>
|
|
</Target>
|
|
|
|
<UsingTask TaskName="GenerateDepsJson" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>
|
|
<!-- After we copied all the framework libraries we need to generate a deps.json file for the shared test framework -->
|
|
<Target Name="GenerateTestSharedFrameworkDepsFile" AfterTargets="SetupTestingHost">
|
|
<ItemGroup>
|
|
<!-- This is for HostPolicy, CoreCLR and Jit dependencies to continue to remain inside of the dep.json -->
|
|
<ExceptionForDepsJson Include="microsoft.netcore.app" />
|
|
|
|
<!-- TODO: We should see about generating this from scratch instead of relying on a previous deps file as a template -->
|
|
<_sharedFrameworkDepsJson Include="$(ToolsDir)dotnetcli\shared\Microsoft.NETCore.App\*\Microsoft.NETCore.App.deps.json" />
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup>
|
|
<_OriginalDepsJsonPath>%(_sharedFrameworkDepsJson.FullPath)</_OriginalDepsJsonPath>
|
|
<_OutputTestSharedFrameworkDepsPath>$(NETCoreAppTestSharedFrameworkPath)\Microsoft.NETCore.App.deps.json</_OutputTestSharedFrameworkDepsPath>
|
|
</PropertyGroup>
|
|
|
|
<GenerateDepsJson DepsJsonPath="$(_OriginalDepsJsonPath)"
|
|
GenerateNewDepsJson="true"
|
|
RuntimeDirectory="$(NETCoreAppTestSharedFrameworkPath)"
|
|
DepsExceptions="@(ExceptionForDepsJson)"
|
|
OutputPath="$(_OutputTestSharedFrameworkDepsPath)"/>
|
|
</Target>
|
|
|
|
<Target Name="SetupTestingHost" AfterTargets="CreateTestOverlay" Condition="'$(CreateTestHost)' != 'false'">
|
|
|
|
<PropertyGroup Condition="'$(OSGroup)'=='Windows_NT'">
|
|
<HostFxrFileName>hostfxr</HostFxrFileName>
|
|
<HostFxrFileExtension>dll</HostFxrFileExtension>
|
|
<DotnetExecutableName>dotnet.exe</DotnetExecutableName>
|
|
<HostPolicyFileName>hostpolicy</HostPolicyFileName>
|
|
<HostPolicyExtension>dll</HostPolicyExtension>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(OSGroup)'!='Windows_NT'">
|
|
<HostFxrFileName>libhostfxr</HostFxrFileName>
|
|
<HostFxrFileExtension Condition="'$(OSGroup)' == 'Linux' Or '$(OSGroup)' == 'FreeBSD'">so</HostFxrFileExtension>
|
|
<HostFxrFileExtension Condition="$(OSGroup) =='OSX'">dylib</HostFxrFileExtension>
|
|
<HostPolicyFileName>libhostpolicy</HostPolicyFileName>
|
|
<HostPolicyExtension>$(HostFxrFileExtension)</HostPolicyExtension>
|
|
<DotnetExecutableName>dotnet</DotnetExecutableName>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<!-- Workaround for packages on which Microsoft.NetCoreApp expresses a dependency
|
|
The <PackageToInclude> element doesn't allow a version to be specified and we end up with clashing assembly versions in Core_Root-->
|
|
<NetCoreAppPackagedAssemblies Include="System.Text.Encoding.CodePages.dll"/>
|
|
<!-- Use xunit dependencies defined in CoreFX.depproj instead of conflicting versions from test dependencies. -->
|
|
<TestDependenciesToExclude Include="$(CORE_ROOT)\**\xunit*"/>
|
|
<CoreCLRBinariesToExclude Include="@(NetCoreAppPackagedAssemblies);@(TestDependenciesToExclude -> '%(Identity)')" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<CoreCLRBinaries Include="$(CORE_ROOT)\**\*.*" Exclude="$(CORE_ROOT)\**\@(CoreCLRBinariesToExclude -> '%(Identity)' )" />
|
|
<HostFxFile Include="$(ToolsDir)\dotnetcli\**\$(HostFxrFileName).$(HostFxrFileExtension)" />
|
|
<DotnetExe Include="$(ToolsDir)\dotnetcli\$(DotnetExecutableName)" />
|
|
<HostPolicyFile Include="$(ToolsDir)\dotnetcli\**\$(HostPolicyFileName).$(HostPolicyExtension)" />
|
|
</ItemGroup>
|
|
|
|
<Copy SourceFiles="@(HostFxFile)"
|
|
DestinationFolder="$(NETCoreAppTestHostFxrPath)"
|
|
SkipUnchangedFiles="true"
|
|
UseHardlinksIfPossible="true" />
|
|
|
|
<!-- Should this be referenced from a NuGet package? -->
|
|
<Copy SourceFiles="@(HostPolicyFile)"
|
|
DestinationFolder="$(NETCoreAppTestSharedFrameworkPath)"
|
|
SkipUnchangedFiles="true"
|
|
UseHardlinksIfPossible="true" />
|
|
|
|
<Copy SourceFiles="@(DotnetExe)"
|
|
DestinationFolder="$(TestHostRootPath)"
|
|
SkipUnchangedFiles="true"
|
|
UseHardlinksIfPossible="true" />
|
|
|
|
<Copy SourceFiles="@(CoreCLRBinaries)"
|
|
DestinationFolder="$(NETCoreAppTestSharedFrameworkPath)"
|
|
SkipUnchangedFiles="true" />
|
|
</Target>
|
|
|
|
<Target Name="RunPerfTests" Condition="'$(Performance)'=='true'">
|
|
<Message Text="Executing steps for perf tests" Importance="High"/>
|
|
|
|
<!-- generate project.json for runtime dependency -->
|
|
<MSBuild Projects="$(MSBuildProjectFile)"
|
|
Targets="CreateTestRuntimeJsonFile"/>
|
|
|
|
<!-- generate project.lock.json file corresponding to above json file -->
|
|
<MSBuild Projects="src\Common\test_dependencies\test_dependencies.csproj"/>
|
|
|
|
<!-- Package each perf test, upload it and trigger event to execute the tests -->
|
|
<MSBuild Projects="$(MSBuildProjectFile)" Targets="UploadPerfAssemblies" />
|
|
</Target>
|
|
|
|
|
|
<Target Name="Build">
|
|
|
|
<!-- generate project.lock.json file corresponding to above json file -->
|
|
<MSBuild Projects="src\Common\test_dependencies\test_dependencies.csproj"
|
|
Condition=" '$(BuildWrappers)'=='true' " />
|
|
|
|
<!-- Default for building -->
|
|
<MSBuild Projects="$(MSBuildProjectFile)"
|
|
Targets="CreateAllWrappers"
|
|
Properties="_CMDDIR=%(TestDirectories.Identity)"
|
|
Condition=" '$(BuildWrappers)'=='true' " />
|
|
|
|
<!-- Execution -->
|
|
|
|
<MSBuild Projects="$(MSBuildProjectFile)"
|
|
Targets="CreateTestOverlay"
|
|
Condition=" '$(GenerateRuntimeLayout)'=='true' "/>
|
|
|
|
<MSBuild Projects="$(MSBuildProjectFile)"
|
|
Targets="CreateTestHost"
|
|
Condition=" '$(GenerateTestHost)'=='true' "/>
|
|
|
|
<MSBuild Projects="$(MSBuildProjectFile)" Targets="RunTests"
|
|
Condition=" '$(RunTests)'=='true' "/>
|
|
</Target>
|
|
|
|
<Target Name="Clean">
|
|
<RemoveDir Condition=" '$(BuildWrappers)'=='true'" Directories="$(XunitWrapperGeneratedCSDirBase);" ContinueOnError="WarnAndContinue" />
|
|
</Target>
|
|
</Project>
|