From fd82afe3826d7778a46bda33db4b6e92de679a05 Mon Sep 17 00:00:00 2001 From: Viktor Hofer Date: Fri, 8 May 2020 22:12:25 +0200 Subject: [PATCH] Enable VS Test Explorer without the -vs switch (#36126) * Enable VS Test Explorer without the -vs switch --- eng/build.ps1 | 1 + eng/testing/coverage.targets | 14 +++++++++++++- eng/testing/runsettings.targets | 26 ++++++++++++-------------- eng/testing/tests.targets | 1 - src/libraries/Directory.Build.props | 4 +++- src/libraries/Directory.Build.targets | 5 +++-- src/libraries/pretest.proj | 11 +++++++++++ 7 files changed, 43 insertions(+), 19 deletions(-) diff --git a/eng/build.ps1 b/eng/build.ps1 index 09d8164516acd..e811cf6db27d7 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -61,6 +61,7 @@ if ($help -or (($null -ne $properties) -and ($properties.Contains('/help') -or $ # VS Test Explorer support for libraries if ($vs) { + Write-Host "!!! VS Test Explorer now works without the -vs switch. The switch will be removed eventually. !!! " . $PSScriptRoot\common\tools.ps1 # Microsoft.DotNet.CoreSetup.sln is special - hosting tests are currently meant to run on the diff --git a/eng/testing/coverage.targets b/eng/testing/coverage.targets index fd53a86bda515..6f8ac2648f06e 100644 --- a/eng/testing/coverage.targets +++ b/eng/testing/coverage.targets @@ -4,7 +4,7 @@ We need to filter the data to only the assembly being tested. Otherwise we will gather tons of data about other assemblies. If the code being tested is part of the runtime itself, it requires special treatment. --> - + <_ProjectDirectoryUnderSourceDir>$(MSBuildProjectDirectory.SubString($(LibrariesProjectRoot.Length))) $(_ProjectDirectoryUnderSourceDir.SubString(0, $(_ProjectDirectoryUnderSourceDir.IndexOfAny("\\/")))) @@ -74,4 +74,16 @@ + + + + + + diff --git a/eng/testing/runsettings.targets b/eng/testing/runsettings.targets index ffd1939b54255..10496127b8a90 100644 --- a/eng/testing/runsettings.targets +++ b/eng/testing/runsettings.targets @@ -1,9 +1,18 @@ - $(MSBuildThisFileDirectory).runsettings - $(OutDir).runsettings + $(MSBuildThisFileDirectory).runsettings + $(ArtifactsObjDir)$(TargetOS)-$(Configuration)-$(TargetArchitecture).runsettings + $(OutDir).runsettings + + false + $(RunSettingsIntermediateOutputFilePath) + $(RunSettingsAppOutputFilePath) + - $(RunSettingsOutputFilePath) + $(RunSettingsAppOutputFilePath) + + $(RunSettingsIntermediateOutputFilePath) + GenerateRunSettingsFile;$(PrepareForRunDependsOn) @@ -41,15 +50,4 @@ $(RunSettingsOutputFilePath) - - - - - diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets index 56097fa6566d2..e4257a349d687 100644 --- a/eng/testing/tests.targets +++ b/eng/testing/tests.targets @@ -217,7 +217,6 @@ - diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index f358b94b2a5ae..49f01af7d36bb 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -327,7 +327,9 @@ true - true + + true + true diff --git a/src/libraries/Directory.Build.targets b/src/libraries/Directory.Build.targets index 7c2f62de0a78f..c2124d089bdbc 100644 --- a/src/libraries/Directory.Build.targets +++ b/src/libraries/Directory.Build.targets @@ -136,9 +136,10 @@ - - + + + diff --git a/src/libraries/pretest.proj b/src/libraries/pretest.proj index eeac3ea516223..a55bd441c79b0 100644 --- a/src/libraries/pretest.proj +++ b/src/libraries/pretest.proj @@ -6,6 +6,12 @@ $(TargetFrameworkIdentifier) + + + true + true + + @@ -19,6 +25,11 @@ Properties="$(TraversalGlobalProperties)" /> + +