diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props index fc6e943a306..5b5e052c0fb 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props @@ -89,6 +89,9 @@ $(XUnitVersion) 3.0.2 + 2.0.0 + 1.6.3 + 3.8.3 $(MSTestVersion) $(MSTestVersion) diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.props index f79111d3e57..25f911cb753 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.props +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.props @@ -29,7 +29,10 @@ - + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.targets index 168c3991a9d..b4579ce475a 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tests.targets @@ -44,6 +44,7 @@ @@ -71,6 +72,8 @@ $(TestResultsLogDir)$(_ResultFileNameNoExt).log $(TestRunSettingsFile) $(TestRunnerAdditionalArguments) + $(RunArguments) + $(RunCommand) diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/VSTest.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/VSTest.targets index 35564525a5c..fcc64fff4e7 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/VSTest.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/VSTest.targets @@ -4,6 +4,9 @@ + + + <_TestEnvironment>%(TestToRun.EnvironmentDisplay) <_TestAssembly>%(TestToRun.Identity) diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnitV3/XUnitV3.Runner.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnitV3/XUnitV3.Runner.targets new file mode 100644 index 00000000000..f60168b4dfe --- /dev/null +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnitV3/XUnitV3.Runner.targets @@ -0,0 +1,93 @@ + + + + + + + + <_TestResultDirectory>$([System.IO.Path]::GetDirectoryName('%(TestToRun.ResultsTrxPath)')) + <_TestResultTrxFileName>$([System.IO.Path]::GetFileName('%(TestToRun.ResultsTrxPath)')) + <_TestResultXmlFileName>$([System.IO.Path]::GetFileName('%(TestToRun.ResultsXmlPath)')) + <_TestResultHtmlFileName>$([System.IO.Path]::GetFileName('%(TestToRun.ResultsHtmlPath)')) + + + + <_TestEnvironment>%(TestToRun.EnvironmentDisplay) + <_TestAssembly>%(TestToRun.Identity) + <_TestRuntime>%(TestToRun.TestRuntime) + <_TestTimeout>%(TestToRun.TestTimeout) + <_TestRunnerAdditionalArguments>%(TestToRun.TestRunnerAdditionalArguments) + + <_TestRunner>%(TestToRun.RunCommand) + <_TestRunnerArgs Condition="'$(UseMicrosoftTestingPlatformRunner)' != 'true'">%(TestToRun.RunArguments) $(_TestRunnerAdditionalArguments) -xml "%(TestToRun.ResultsXmlPath)" -html "%(TestToRun.ResultsHtmlPath)" -trx "%(TestToRun.ResultsTrxPath)" + <_TestRunnerArgs Condition="'$(UseMicrosoftTestingPlatformRunner)' == 'true'">%(TestToRun.RunArguments) $(_TestRunnerAdditionalArguments) --results-directory "$(_TestResultDirectory)" --report-xunit --report-xunit-filename "$(_TestResultXmlFileName)" --report-xunit-html --report-xunit-html-filename "$(_TestResultHtmlFileName)" --report-trx --report-trx-filename "$(_TestResultTrxFileName)" + + $(DotNetRoot) + + + + <_TestRunnerArgs Condition="'$(UseMicrosoftTestingPlatformRunner)' != 'true'">$(_TestRunnerArgs) -noAutoReporters + <_TestRunnerArgs Condition="'$(UseMicrosoftTestingPlatformRunner)' == 'true'">$(_TestRunnerArgs) --auto-reporters off + + + + <_TestRunnerCommand>"$(_TestRunner)" $(_TestRunnerArgs) + + + <_TestRunnerCommand Condition="'$(TestCaptureOutput)' != 'false'">$(_TestRunnerCommand) >> "%(TestToRun.ResultsStdOutPath)" 2>&1 + + + + <_OutputFiles Include="%(TestToRun.ResultsXmlPath)" /> + <_OutputFiles Include="%(TestToRun.ResultsHtmlPath)" /> + <_OutputFiles Include="%(TestToRun.ResultsStdOutPath)" /> + + + + + + + + + + + + + + + + + + + <_ResultsFileToDisplay>%(TestToRun.ResultsHtmlPath) + <_ResultsFileToDisplay Condition="!Exists('$(_ResultsFileToDisplay)')">%(TestToRun.ResultsStdOutPath) + + + + + + + + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnitV3/XUnitV3.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnitV3/XUnitV3.targets new file mode 100644 index 00000000000..e8e529cec4a --- /dev/null +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnitV3/XUnitV3.targets @@ -0,0 +1,47 @@ + + + + + false + + + true + + + + + + + + + + + + + + + + + $(MSBuildThisFileDirectory)xunit.runner.json + $(MSBuildThisFileDirectory)xunit.runner.json + + + + + + + + + + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnitV3/xunit.runner.json b/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnitV3/xunit.runner.json new file mode 100644 index 00000000000..8465a454364 --- /dev/null +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnitV3/xunit.runner.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "shadowCopy": false +}