You've already forked linux-packaging-mono
356 lines
21 KiB
XML
356 lines
21 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<!-- This is the target that copies the test assets to the test output -->
|
|
<Import Project="$(MSBuildThisFileDirectory)publishtest.targets" />
|
|
<Import Project="$(ToolsDir)PerfTesting.targets" Condition="Exists('$(ToolsDir)PerfTesting.targets') and '$(Performance)' == 'true'"/>
|
|
<UsingTask TaskName="GenerateTestExecutionScripts" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>
|
|
<UsingTask TaskName="GetTargetMachineInfo" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>
|
|
|
|
<!-- Which categories of tests to run by default -->
|
|
<PropertyGroup>
|
|
<TestDisabled>false</TestDisabled>
|
|
<TestDisabled Condition="'$(IsTestProject)'!='true' Or '$(SkipTests)'=='true' Or '$(RunTestsForProject)'=='false'">true</TestDisabled>
|
|
<TestsSuccessfulSemaphore>tests.passed</TestsSuccessfulSemaphore>
|
|
</PropertyGroup>
|
|
|
|
<!-- In case that TestPath is not yet set, default it here -->
|
|
<PropertyGroup>
|
|
<TestPath Condition="'$(TestPath)'==''">$(OutDir)</TestPath>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<!-- Split semicolon separated lists -->
|
|
<WithCategoriesItems Include="$(WithCategories)" />
|
|
<WithoutCategoriesItems Include="$(WithoutCategories)" />
|
|
<DefaultNoCategories Include="$(DefaultNoCategories)" />
|
|
<UnsupportedPlatformsItems Include="$(UnsupportedPlatforms)"/>
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup Condition="'$(BuildingNETFxVertical)' != 'true'">
|
|
<XunitRuntimeConfig>$(ToolsDir)\xunit.console.netcore.runtimeconfig.json</XunitRuntimeConfig>
|
|
<TestRuntimeEnvVar Condition="'$(OS)' == 'Windows_NT'">%RUNTIME_PATH%\</TestRuntimeEnvVar>
|
|
<TestRuntimeEnvVar Condition="'$(OS)' != 'Windows_NT'">$RUNTIME_PATH/</TestRuntimeEnvVar>
|
|
<TestHostExecutablePath Condition="'$(OS)'=='Windows_NT' AND '$(TestHostExecutablePath)' == '' AND '$(BuildingUAPAOTVertical)' != 'true'">$(TestRuntimeEnvVar)dotnet.exe</TestHostExecutablePath>
|
|
<TestHostExecutablePath Condition="'$(OS)'!='Windows_NT' AND '$(TestHostExecutablePath)' == '' AND '$(BuildingUAPAOTVertical)' != 'true'">$(TestRuntimeEnvVar)dotnet</TestHostExecutablePath>
|
|
|
|
<XunitExecutable Condition="'$(XunitExecutable)' == ''">xunit.console.netcore.exe</XunitExecutable>
|
|
|
|
<DebugEngines>{2E36F1D4-B23C-435D-AB41-18E608940038}</DebugEngines>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup Condition="'$(BuildingNETFxVertical)' == 'true'">
|
|
<XunitExecutable Condition="'$(XunitExecutable)' == ''">xunit.console.exe</XunitExecutable>
|
|
</PropertyGroup>
|
|
|
|
<!-- General xunit options -->
|
|
<PropertyGroup>
|
|
<XunitResultsFileName>testResults.xml</XunitResultsFileName>
|
|
|
|
<XunitOptions Condition="'$(BuildingNETFxVertical)' == 'true'">$(XunitOptions) -noshadow</XunitOptions>
|
|
<XunitOptions Condition="'$(BuildingNETFxVertical)' == 'true' and '$(XUnitNoAppdomain)' == 'true'">$(XunitOptions) -noappdomain </XunitOptions>
|
|
<XunitOptions>$(XunitOptions) -xml $(XunitResultsFileName)</XunitOptions>
|
|
|
|
<XunitOptions Condition="'$(Performance)'!='true'">$(XunitOptions) -notrait Benchmark=true</XunitOptions>
|
|
<XunitOptions Condition="'$(BuildingUAPAOTVertical)'=='true'">$(XunitOptions) -redirectoutput</XunitOptions>
|
|
|
|
<XunitOptions>$(XunitOptions) -notrait category=non$(_bc_TargetGroup)tests</XunitOptions>
|
|
|
|
<XunitOptions Condition="'$(XunitMaxThreads)'!=''">$(XunitOptions) -maxthreads $(XunitMaxThreads)</XunitOptions>
|
|
<XunitTestAssembly Condition="'$(XunitTestAssembly)' == ''">$(TargetFileName)</XunitTestAssembly>
|
|
<XunitArguments>$(XunitTestAssembly) $(XunitOptions)</XunitArguments>
|
|
|
|
<TestProgram Condition="'$(TestHostExecutablePath)'!=''">$(TestHostExecutablePath)</TestProgram>
|
|
<TestArguments Condition="'$(TestHostExecutablePath)'!=''">$(XunitExecutable) $(XunitArguments)</TestArguments>
|
|
|
|
<TestProgram Condition="'$(TestHostExecutablePath)'==''">$(XunitExecutable)</TestProgram>
|
|
<TestArguments Condition="'$(TestHostExecutablePath)'==''">$(XunitArguments)</TestArguments>
|
|
|
|
<TestCommandLine Condition="'$(Performance)'!='true'">$(TestProgram) $(TestArguments) {XunitTraitOptions}</TestCommandLine>
|
|
|
|
<!-- set $(TestDebugger) to eg c:\debuggers\windbg.exe to run tests under a debugger -->
|
|
<TestCommandLine Condition="'$(TestDebugger)' != '' and !$(TestDebugger.Contains('devenv'))">$(TestDebugger) $(TestCommandLine)</TestCommandLine>
|
|
<TestCommandLine Condition="'$(TestDebugger)' != '' and $(TestDebugger.Contains('devenv'))">$(TestDebugger) /debugexe $(TestCommandLine)</TestCommandLine>
|
|
|
|
</PropertyGroup>
|
|
|
|
<!-- The Code Coverage targets will override TestHost and TestCommandLine if coverage is enabled -->
|
|
<Import Project="$(MSBuildThisFileDirectory)CodeCoverage.targets" />
|
|
|
|
<!-- In VS (2015 Preview or later currently required): Debug to run unit tests on CoreCLR. -->
|
|
<PropertyGroup Condition="'$(IsTestProject)'=='true'">
|
|
<StartWorkingDirectory Condition="'$(StartWorkingDirectory)'==''">$(TestPath)</StartWorkingDirectory>
|
|
<StartAction Condition="'$(StartAction)'==''">Program</StartAction>
|
|
<StartProgram Condition="'$(StartProgram)'==''">$(TestSharedFxDir)dotnet.exe</StartProgram>
|
|
<StartArguments Condition="'$(StartArguments)'==''">$(TestArguments) -wait -parallel none</StartArguments>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="DiscoverTestInputs" DependsOnTargets="ResolveReferences;GetCopyToOutputDirectoryItems">
|
|
<ItemGroup>
|
|
<RunTestsForProjectInputs Include="@(ReferenceCopyLocalPaths)" />
|
|
<RunTestsForProjectInputs Include="@(Content)" />
|
|
<RunTestsForProjectInputs Include="@(IntermediateAssembly)" />
|
|
<RunTestsForProjectInputs Include="@(_DebugSymbolsIntermediatePath)" />
|
|
<RunTestsForProjectInputs Include="@(AllItemsFullPathWithTargetPath)" />
|
|
</ItemGroup>
|
|
<ItemGroup Condition="'$(BuildingNETFxVertical)' != 'true'">
|
|
<SupplementalTestData Include="$(XunitRuntimeConfig)" />
|
|
<SupplementalTestData Include="$(RuntimePath)xunit.console.netcore.exe" />
|
|
</ItemGroup>
|
|
<ItemGroup Condition="'$(BuildingNETFxVertical)' == 'true'">
|
|
<SupplementalTestData Include="$(RuntimePath)xunit.console.exe" />
|
|
<SupplementalTestData Include="$(RuntimePath)xunit.console.exe.config" />
|
|
<SupplementalTestData Include="$(RuntimePath)xunit.execution.desktop.dll" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="AddDefaultTestReferences" BeforeTargets="SetupDefaultReferences">
|
|
<ItemGroup Condition="'$(IsTestProject)'=='true' and '$(IncludeDefaultReferences)' == 'true'">
|
|
<TargetingPackExclusions Include="System.Runtime.WindowsRuntime.UI.Xaml" /> <!-- Harmless, but causes PRI targets to run -->
|
|
<TargetingPackExclusions Include="@(ReferenceFromRuntime)"/>
|
|
|
|
<!-- Whitelisted runtime assemblies that are OK to reference. -->
|
|
<ReferenceFromRuntime Include="xunit.core" />
|
|
<ReferenceFromRuntime Include="Xunit.NetCore.Extensions" />
|
|
<ReferenceFromRuntime Include="xunit.assert" />
|
|
<ReferenceFromRuntime Include="xunit.abstractions" />
|
|
<ReferenceFromRuntime Include="xunit.performance.core" />
|
|
<ReferenceFromRuntime Include="xunit.performance.api" />
|
|
|
|
<!-- Reference everything in the targeting pack directory -->
|
|
<TargetingPackItems Include="%(TargetingPackDirs.Identity)/*.dll" />
|
|
|
|
<DefaultReference Include="%(TargetingPackItems.Filename)" Exclude="@(TargetingPackExclusions)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="CopyRemoteExecutionConfigFile"
|
|
BeforeTargets="GenerateTestExecutionScripts"
|
|
Condition="'$(BuildingNETFxVertical)' == 'true' And Exists('$(TestPath)\RemoteExecutorConsoleApp.exe')">
|
|
|
|
<Copy SourceFiles="$(RuntimePath)\xunit.console.exe.config"
|
|
DestinationFiles="$(TestPath)\RemoteExecutorConsoleApp.exe.config"
|
|
SkipUnchangedFiles="true"
|
|
/>
|
|
</Target>
|
|
|
|
<!-- Generate the script to run the tests. The script performs two high-level steps:
|
|
1. Copies the common test runtime dependencies calculated in DiscoverTestDependencies to the test
|
|
execution directory. Each copy command no-ops if the file already exists in the test execution
|
|
directory.
|
|
2. Runs the tests. -->
|
|
<Target Name="GenerateTestExecutionScripts"
|
|
DependsOnTargets="DiscoverTestInputs;SetupTestProperties">
|
|
<PropertyGroup>
|
|
<TargetOSTrait Condition="'$(TargetOS)'=='Windows_NT'">nonwindowstests</TargetOSTrait>
|
|
<TargetOSTrait Condition="'$(TargetOS)'=='Linux'">nonlinuxtests</TargetOSTrait>
|
|
<TargetOSTrait Condition="'$(TargetOS)'=='OSX'">nonosxtests</TargetOSTrait>
|
|
<TargetOSTrait Condition="'$(TargetOS)'=='FreeBSD'">nonfreebsdtests</TargetOSTrait>
|
|
<TargetOSTrait Condition="'$(TargetOS)'=='NetBSD'">nonnetbsdtests</TargetOSTrait>
|
|
</PropertyGroup>
|
|
<Error Condition="'$(TargetOSTrait)' == ''" Text="TargetOS [$(TargetOS)] is unknown so we don't know how to configure the test run for this project [$(MSBuildProjectName)]" />
|
|
|
|
<ItemGroup>
|
|
<RunWithoutTraits Condition="'$(TargetOSTrait)'!=''" Include="$(TargetOSTrait)" />
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup>
|
|
<RunnerScriptName Condition="'$(TargetOS)'=='Windows_NT'" >RunTests.cmd</RunnerScriptName>
|
|
<RunnerTemplateName Condition="'$(TargetOS)'=='Windows_NT'" >RunnerTemplate.Windows.txt</RunnerTemplateName>
|
|
<RunnerScriptName Condition="'$(TargetOS)'!='Windows_NT'" >RunTests.sh</RunnerScriptName>
|
|
<RunnerTemplateName Condition="'$(TargetOS)'!='Windows_NT'" >RunnerTemplate.Unix.txt</RunnerTemplateName>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<XunitTraitOptions Condition="'@(RunWithTraits)'!=''">$(XunitTraitOptions) -trait category=@(RunWithTraits, ' -trait category=') </XunitTraitOptions>
|
|
<XunitTraitOptions Condition="'@(RunWithoutTraits)'!=''">$(XunitTraitOptions) -notrait category=@(RunWithoutTraits, ' -notrait category=') </XunitTraitOptions>
|
|
</PropertyGroup>
|
|
|
|
<!-- Replace the {XunitTraitOptions} place holder with the actual traits. We use the place holder
|
|
because code coverage needs to have a bit of the test command line after the traits (it adds ending quotes
|
|
to one of its options). Simply appending the traits would break code coverage.
|
|
Additionally, replace CoreRun.exe with ./corerun on Non-Windows OSes (this is the only difference in the command)
|
|
Future refactoring will allow us to construct this correctly initially, but we don't always know the TargetOS
|
|
when the properties are set currently. -->
|
|
<PropertyGroup>
|
|
<TestCommandLine>$(TestCommandLine.Replace('{XunitTraitOptions}', '$(XunitTraitOptions)'))</TestCommandLine>
|
|
|
|
<!-- We also need to replace {CoverageFilter} with its true value, which should be evaluated correctly at this point. -->
|
|
<TestCommandLine>$(TestCommandLine.Replace('{CoverageFilter}', '$(CoverageFilter)'))</TestCommandLine>
|
|
|
|
<OutputFolderForScriptGenerator>$(TestPath)</OutputFolderForScriptGenerator>
|
|
<OutputPathForScriptGenerator>$(OutputFolderForScriptGenerator)/$(RunnerScriptName)</OutputPathForScriptGenerator>
|
|
<OutputFolderForTestDependencies>$(BinDir)/TestDependencies</OutputFolderForTestDependencies>
|
|
</PropertyGroup>
|
|
|
|
<MakeDir Condition="'$(CoverageEnabledForProject)'=='true'" Directories="$(CoverageReportDir)" />
|
|
|
|
<MakeDir Directories="$(OutputFolderForTestDependencies)" />
|
|
<PropertyGroup>
|
|
<_TestDependencyListRoot>$(MSBuildProjectName)-$(TestConfiguration)</_TestDependencyListRoot>
|
|
<_TestDependencyListFileName>$(_TestDependencyListRoot).dependencylist.txt</_TestDependencyListFileName>
|
|
<TestDependencyListFilePath>$(OutputFolderForTestDependencies)/$(_TestDependencyListFileName)</TestDependencyListFilePath>
|
|
</PropertyGroup>
|
|
<Message Text="Generating $(TestDependencyListFilePath)" />
|
|
<WriteLinesToFile
|
|
File="$(TestDependencyListFilePath)"
|
|
Lines="@(IncludedFileForRunnerScript -> '%(PackageRelativePath)')"
|
|
Overwrite="true"
|
|
Encoding="Ascii" />
|
|
|
|
<PropertyGroup Condition="'$(UseDotNetNativeToolchain)' == 'true'">
|
|
<ILCBuildType Condition="'$(ILCBuildType)' == ''">ret</ILCBuildType>
|
|
</PropertyGroup>
|
|
|
|
<!-- For .NET Native compilation, we first need to generate a native executable if possible. -->
|
|
<ItemGroup Condition="'$(UseDotNetNativeToolchain)' == 'true' AND '$(Performance)'!='true'" >
|
|
<IlcInputFolderContents Include="$(ILCFXInputFolder)/*" />
|
|
<TestCommandLines Include="mklink /H %(IlcInputFolderContents.Filename)%(IlcInputFolderContents.Extension) %(IlcInputFolderContents.FullPath)" />
|
|
<TestCommandLines Include="copy /y $(TestILCFolder)\default.rd.xml %EXECUTION_DIR%" />
|
|
<TestCommandLines Include="call $(TestILCFolder)\ilc.exe -ExeName xunit.console.netcore.exe -in %EXECUTION_DIR% -out %EXECUTION_DIR%\native -usedefaultpinvoke -buildtype $(ILCBuildType) -v diag || exit /b %ERRORLEVEL%"/>
|
|
<TestCommandLines Include="copy /y $(TestILCFolder)\CRT\vcruntime140_app.dll %EXECUTION_DIR%\native" />
|
|
<TestCommandLines Include="echo > %EXECUTION_DIR%\native\$(XunitTestAssembly)"/>
|
|
<TestCommandLines Include="cd native"/>
|
|
<PostExecutionTestCommandLines Include="type Xunit.Console.Output.txt" />
|
|
<PostExecutionTestCommandLines Include="copy /y testResults.xml %EXECUTION_DIR%\" />
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup Condition="'$(BuildingUAPVertical)' == 'true'">
|
|
<!-- The location where the logs will be written by the test runner -->
|
|
<UAP_Results_Path Condition="'$(UAP_Results_Path)'==''">%USERPROFILE%\Documents\TestResults\</UAP_Results_Path>
|
|
|
|
<_Runtime_Path>%RUNTIME_PATH%\UAPLayout\</_Runtime_Path>
|
|
<!-- Make sure the path only has one type of slashes -->
|
|
<_Runtime_Path>$(_Runtime_Path.Replace('/', '\'))</_Runtime_Path>
|
|
|
|
<!-- The test execution command is different for UAP. -->
|
|
<TestCommandLine>%RUNTIME_PATH%\Launcher\WindowsStoreAppLauncher.exe -test appxmanifest.xml $(XunitArguments) $(XunitTraitOptions)</TestCommandLine>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup Condition="'$(BuildingUAPVertical)' == 'true'" >
|
|
<!-- Copy the runner files into the test directory -->
|
|
<RunnerFolderContents Include="$(NETCoreAppTestRootPath)\Runner\**\*" />
|
|
|
|
<TestCommandLines Include="mkdir Assets" />
|
|
<TestCommandLines Include="mkdir entrypoint" />
|
|
<TestCommandLines Include="mkdir Properties" />
|
|
<TestCommandLines Include="mkdir WinMetadata" />
|
|
<TestCommandLines Include="mklink /H %(RunnerFolderContents.RecursiveDir)%(RunnerFolderContents.Filename)%(RunnerFolderContents.Extension) %RUNTIME_PATH%\Runner\%(RunnerFolderContents.RecursiveDir)%(RunnerFolderContents.Filename)%(RunnerFolderContents.Extension)" />
|
|
|
|
<!-- Copy the runtime binaries over -->
|
|
<RuntimePathContents Include="$(RuntimePath)\**\*" />
|
|
<TestCommandLines Include="mklink /H %(RuntimePathContents.RecursiveDir)%(RuntimePathContents.Filename)%(RuntimePathContents.Extension) $(_Runtime_Path)%(RuntimePathContents.Filename)%(RuntimePathContents.Extension)" />
|
|
|
|
<!-- Copy the log files and the results files from the Documents folder to the test folder -->
|
|
<PostExecutionTestCommandLines Include="move $(UAP_Results_Path)$(XunitTestAssembly).xml .\$(XunitResultsFileName)" />
|
|
<PostExecutionTestCommandLines Include="move $(UAP_Results_Path)$(XunitTestAssembly).txt .\logs.txt" />
|
|
<PostExecutionTestCommandLines Include="type logs.txt" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup Condition="'$(Performance)'!='true'">
|
|
<!-- On Windows, call prevents the test command from making execution end prematurely -->
|
|
<TestCommandLines Condition="'$(TargetOS)'=='Windows_NT'" Include="call $(TestCommandLine)"/>
|
|
<TestCommandLines Condition="'$(TargetOS)'!='Windows_NT'" Include="$(TestCommandLine)"/>
|
|
</ItemGroup>
|
|
|
|
<ItemGroup Condition ="'$(Performance)'=='true'">
|
|
<TestCommandLines Include="@(PerfTestCommandLines)" />
|
|
</ItemGroup>
|
|
|
|
<!-- Do not put anything between this Item Group and the GenerateTestExecutionScripts invocation -->
|
|
<ItemGroup>
|
|
<TestCommandLines Include="@(PostExecutionTestCommandLines)" />
|
|
</ItemGroup>
|
|
|
|
<GenerateTestExecutionScripts
|
|
TestCommands="@(TestCommandLines)"
|
|
TestDependencies="@(DontIncludeAnything)"
|
|
RunnerScriptTemplate="$(MSBuildThisFileDirectory)/$(RunnerTemplateName)"
|
|
ScriptOutputPath ="$(OutputPathForScriptGenerator)"
|
|
/>
|
|
</Target>
|
|
|
|
<Target Name="RunTestsForProject"
|
|
Condition="'$(TestDisabled)' != 'true'"
|
|
DependsOnTargets="DiscoverTestInputs;CheckTestCategories"
|
|
Inputs="@(RunTestsForProjectInputs)"
|
|
Outputs="$(TestsSuccessfulSemaphore);$(TestPath)/$(XunitResultsFileName);$(CoverageOutputFilePath)"
|
|
>
|
|
|
|
<MakeDir Condition="'$(CoverageEnabledForProject)'=='true'" Directories="$(CoverageReportDir)" />
|
|
<Error Text="TestILCFolder property is required for running uapaot tests. Please pass in the full path to the directory that contains ilc.exe to msbuild using /p:TestILCFolder=path_to_ilc_dir.exe" Condition="'$(BuildingUAPAOTVertical)' == 'true' AND '$(TestILCFolder)' == ''" />
|
|
|
|
<!-- For UAP, make sure the Runner and Launcher folder exist, otherwise the tests cannot run -->
|
|
<Error Text="We cannot run the tests for UAP because either the Runner or the Launcher could not be found. You need to specify the UAPToolsFolder property when calling build.cmd to fix this."
|
|
Condition="'$(BuildingUAPVertical)'=='true' and (!Exists('$(NETCoreAppTestRootPath)\Runner') or !Exists('$(NETCoreAppTestRootPath)\Launcher'))" />
|
|
|
|
<Exec Command="$(TestPath)/$(RunnerScriptName) $(TestSharedFxDir)"
|
|
CustomErrorRegularExpression="Failed: [^0]"
|
|
ContinueOnError="true"
|
|
IgnoreStandardErrorWarningFormat="true"
|
|
>
|
|
<Output PropertyName="TestRunExitCode" TaskParameter="ExitCode" />
|
|
</Exec>
|
|
|
|
<Error Condition="'$(TestDisabled)'!='true' And '$(TestRunExitCode)' != '0'" Text="One or more tests failed while running tests from '$(MSBuildProjectName)' please check $(TestPath)$(XunitResultsFileName) for details!" />
|
|
<Touch Condition="'$(TestRunExitCode)' == '0'" Files="$(TestsSuccessfulSemaphore)" AlwaysCreate="true" />
|
|
</Target>
|
|
|
|
<!-- Needs to run before RunTestsForProject target as it computes categories and set TestDisabled -->
|
|
<Target Name="CheckTestCategories">
|
|
|
|
<!-- Default behavior is to disable OuterLoop and failing tests if not specified in WithCategories. -->
|
|
<ItemGroup>
|
|
<DefaultNoCategories Condition="'$(Outerloop)'!='true'" Include="OuterLoop" />
|
|
<DefaultNoCategories Include="failing" />
|
|
<WithoutCategoriesItems Include="@(DefaultNoCategories)" Exclude="@(WithCategoriesItems)" />
|
|
<WithoutCategoriesItemsDistinct Include="@(WithoutCategoriesItems->Distinct())" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<RunWithTraits Condition="'@(WithCategoriesItems)'!=''" Include="@(WithCategoriesItems)" />
|
|
<RunWithoutTraits Condition="'@(WithoutCategoriesItemsDistinct)'!=''" Include="@(WithoutCategoriesItemsDistinct)" />
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup>
|
|
<TestsSuccessfulSemaphore Condition="'@(RunWithTraits)' != ''">$(TestsSuccessfulSemaphore).with.@(RunWithTraits, '.')</TestsSuccessfulSemaphore>
|
|
<TestsSuccessfulSemaphore Condition="'@(RunWithoutTraits)' != ''">$(TestsSuccessfulSemaphore).without.@(RunWithoutTraits, '.')</TestsSuccessfulSemaphore>
|
|
<TestsSuccessfulSemaphore>$(TestPath)/$(TestsSuccessfulSemaphore)</TestsSuccessfulSemaphore>
|
|
</PropertyGroup>
|
|
|
|
<Delete Condition="'$(ForceRunTests)'=='true' And Exists($(TestsSuccessfulSemaphore))"
|
|
Files="$(TestsSuccessfulSemaphore)" />
|
|
</Target>
|
|
|
|
<Target Name="CheckTestPlatforms">
|
|
<PropertyGroup>
|
|
<TargetOS Condition="'$(TargetOS)' == ''">$(DefaultOSGroup)</TargetOS>
|
|
<TestDisabled Condition="'%(UnsupportedPlatformsItems.Identity)' == '$(TargetOS)' Or '$(ConfigurationErrorMsg)' != ''">true</TestDisabled>
|
|
</PropertyGroup>
|
|
<Message Text="CheckTestPlatforms found TargetOS of [$(TargetOS)]." Importance="Low" />
|
|
<Message Condition="'%(UnsupportedPlatformsItems.Identity)' == '$(TargetOS)'"
|
|
Text="Skipping tests in $(AssemblyName) because it is not supported on $(TargetOS)" />
|
|
<Message Condition="'$(ConfigurationErrorMsg)' != ''"
|
|
Text="Skipping tests in $(AssemblyName) because there is no configuration compatible with the current BuildConfiguration." />
|
|
</Target>
|
|
|
|
<Target Name="SetupTestProperties" DependsOnTargets="CheckTestPlatforms;CheckTestCategories" />
|
|
|
|
<PropertyGroup>
|
|
<TestDependsOn>
|
|
$(TestDependsOn);
|
|
CopySupplementalTestData;
|
|
GenerateTestExecutionScripts;
|
|
RunTestsForProject;
|
|
ArchiveTestBuild
|
|
</TestDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="Test" DependsOnTargets="$(TestDependsOn)" />
|
|
<Target Name="BuildAndTest" DependsOnTargets="Build;Test" />
|
|
<Target Name="RebuildAndTest" DependsOnTargets="Rebuild;Test" />
|
|
|
|
<!-- This helps collect crash dumps and requires python installed -->
|
|
<Import Project="$(MSBuildThisFileDirectory)Dumpling.targets" Condition="'$(EnableDumpling)' == 'true' OR '$(EnableCloudTest)' == 'true'" />
|
|
</Project>
|