Private runtime build testing
=============================
-Here are some instructions on how to run the diagnostics repo's tests against a locally build private .NET Core runtime based on CoreCLR. These directions will work on Windows, Linux and MacOS.
+Here are some instructions on how to run the diagnostics repo's tests against a locally built private .NET Core runtime based on CoreCLR. These directions will work on Windows, Linux and MacOS. The testing is currently scoped to just the runtime not the libraries and not single-file apps.
-1. Build the runtime repo (see [Workflow Guide](https://github.com/dotnet/runtime/blob/main/docs/workflow/README.md)).
+1. Build the runtime repo (see [Workflow Guide](https://github.com/dotnet/runtime/blob/main/docs/workflow/README.md)) with `-configuration release -subset clr`. A release build is highly recommended.
2. Build the diagnostics repo (see [Building the Repository](../README.md)).
-3. Run the diagnostics repo tests with the -privatebuildpath option.
+3. Run the `eng\privatebuild.cmd` or `eng/privatebuild.sh` test runtime install script. This installs and sets up to run (just) the latest test runtimes (currently 9.0) into the `.dotnet-test` directory.
+4. On Windows 11 (this doesn't work on Windows 10), add the following DWORD registry key: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\MiniDumpSettings\DisableAuxProviderSignatureCheck` and set it to 1. This allows the unsigned privately built DAC to be used to generate dumps.
+5. Copy the private runtime binaries over the test SDK/runtimes installed in `.dotnet-test`. This step is hard to automate because there are usually 3 versions of the runtime installed: one as part of the .NET SDK, one as part of the AspNetCore runtime and one from latest runtime DARC update.
+6. Run the diagnostics repo tests either:
+ a. `test.cmd` or `test.sh` - this runs all the diagnostics tests including SOS's. A html test report will be generated in `artifacts/TestResults/{Debug,Release}/SOS.UnitTests_net6.0_x64.html`.
+ b. Use the VS Test Explorer to run all the SOS tests or a specific one.
+ c. Use `eng\testsos.cmd` or `eng/testsos.sh` to run just the SOS tests. The html test report isn't generated in this case, but the SOS test logs are in artifacts/TestResults/{Debug,Release}/sos_*.
-The following examples assume a Debug build of the runtime and diagnsotics. However any flavor can be used with the following steps:
+The following examples assume a release build of the runtime. The runtime version numbers will vary.
+
+#### Windows x64 Example Script
-On Windows:
-```
-C:\diagnostics> test -privatebuildpath c:\runtime\artifacts\bin\coreclr\Windows_NT.x64.Debug
```
+copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\sharedFramework\* c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.7.24366.18
+copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\System.Private.CoreLib.dll c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.7.24366.18
-When you are all done with the private runtime testing, run this command to remove the Windows registry entries added in the above steps.
+copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\sharedFramework\* c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.7.24365.2
+copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\System.Private.CoreLib.dll c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.7.24365.2
-```
-C:\diagnostics> test -cleanupprivatebuild
+copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\sharedFramework\* c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.4.24251.3
+copy c:\src\runtime\artifacts\bin\coreclr\windows.x64.Release\System.Private.CoreLib.dll c:\src\diagnostics\.dotnet-test\shared\Microsoft.NETCore.App\9.0.0-preview.4.24251.3
```
-There will be some popups from regedit asking for administrator permission to edit the registry (press Yes), warning about adding registry keys from AddPrivateTesting.reg (press Yes) and that the edit was successful (press OK).
+#### Linux x64 Example Script
-On Linux/MacOS:
```
-~/diagnostics$ ./test.sh --privatebuildpath /home/user/runtime/artifacts/bin/coreclr/Linux.x64.Debug
+cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/sharedFramework/* $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.7.24366.18
+cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/System.Private.CoreLib.dll $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.7.24366.18
+
+cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/sharedFramework/* $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.7.24365.2
+cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/System.Private.CoreLib.dll $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.7.24365.2
+
+cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/sharedFramework/* $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.4.24251.3
+cp -v $HOME/runtime/artifacts/bin/coreclr/linux.x64.Release/System.Private.CoreLib.dll $HOME/diagnostics/.dotnet-test/shared/Microsoft.NETCore.App/9.0.0-preview.4.24251.3
```
-The private runtime will be copied to the diagnostics repo and the tests started. It can be just the runtime binaries but this assumes that the private build is close to the latest published main build. If not, you can pass the runtime's testhost directory containing all the shared runtime bits i.e. `c:\runtime\artifacts\bin\coreclr\testhost\netcoreapp5.0-Windows_NT-Debug-x64\shared\Microsoft.NETCore.App\5.0.0` or `/home/user/runtime/artifacts/bin/coreclr/testhost/netcoreapp5.0-Linux-Release-x64/shared/Microsoft.NETCore.App/5.0.0`
On Linux/MacOS it is recommended to test against Release runtime builds because of a benign assert in DAC (tracked by issue #[31897](https://github.com/dotnet/runtime/issues/31897)) that causes the tests to fail.
-On Windows the DAC is not properly signed for a private runtime build so there are a couple of registry keys that need to be added so Windows will load the DAC and the tests can create proper mini-dumps. An example of the registry key values added are:
+#### Note for Windows 10
+
+Because the DAC is not properly signed for a private runtime build there are a couple of registry keys that need to be added so Windows will load the DAC and the tests can create proper mini-dumps. An example of the registry key values added are:
```
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\KnownManagedDebuggingDlls]
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<ExtensionPackage>
- <Name>SOS</Name>
- <Version>X.X.X.X</Version>
- <Description>Debugging aid for .NET Core programs and runtimes</Description>
- <Components>
- <BinaryComponent Name="sos" Type="Engine">
- <Files>
- <File Architecture="amd64" Module="x64\sos.dll" />
- <File Architecture="x86" Module="x86\sos.dll" />
- <File Architecture="arm32" Module="arm32\sos.dll" />
- </Files>
- <LoadTriggers>
- <TriggerSet>
- <ModuleTrigger Name="coreclr.dll" />
- </TriggerSet>
- </LoadTriggers>
- <EngineCommands>
- <EngineCommand Name="clrstack">
- <EngineCommandItem>
- <Syntax>!clrstack</Syntax>
- <Description>Provides a stack trace of managed code only</Description>
- </EngineCommandItem>
- </EngineCommand>
- <EngineCommand Name="clrthreads">
- <EngineCommandItem>
- <Syntax>!clrthreads</Syntax>
- <Description>List the managed threads running</Description>
- </EngineCommandItem>
- </EngineCommand>
- <EngineCommand Name="soshelp">
- <EngineCommandItem>
- <Syntax>!soshelp</Syntax>
- <Description>Displays all available SOS commands or details about the command</Description>
- </EngineCommandItem>
- </EngineCommand>
- </EngineCommands>
- </BinaryComponent>
- </Components>
-</ExtensionPackage>
$(MicrosoftDotnetSdkInternalVersion) - .NET SDK to use for testing
$(InternalReleaseTesting) - if true, internal service release testing
+ $(PrivateBuildTesting) - if true, test against a locally built runtime
@(RuntimeTestVersions) - runtime/aspnetcore versions to install and test against
From Arcade:
<CommonInstallArgs>-NoPath -SkipNonVersionedFiles -Architecture $(BuildArch) -InstallDir $(DotNetInstallRoot)</CommonInstallArgs>
<DotNetInstallDir>$([MSBuild]::NormalizeDirectory('$(DotNetInstallRoot)', 'shared', 'Microsoft.NETCore.App', '$(MicrosoftNETCoreAppRuntimewinx64Version)'))</DotNetInstallDir>
<TestConfigFileName>$(DotNetInstallRoot)Debugger.Tests.Versions.txt</TestConfigFileName>
- <AddRegeditFileName>$(DotNetInstallRoot)AddPrivateTesting.reg</AddRegeditFileName>
- <RemoveRegeditFileName>$(DotNetInstallRoot)RemovePrivateTesting.reg</RemoveRegeditFileName>
- <RegeditCommand>regedit.exe</RegeditCommand>
</PropertyGroup>
<Choose>
<![CDATA[
<Configuration>
<InternalReleaseTesting>$(InternalReleaseTesting)</InternalReleaseTesting>
+ <PrivateBuildTesting>$(PrivateBuildTesting)</PrivateBuildTesting>
]]>
</ConfigFileEntry>
</TestConfigFileLines>
-->
<Target Name="CleanupVersionManifest"
- Condition="$(InternalReleaseTesting)">
+ Condition="$(InternalReleaseTesting) or $(PrivateBuildTesting)">
<!-- Make sure the config file gets regenerated in the WriteTestVersionManifest target -->
<Delete Files="$(TestConfigFileName)" />
</PropertyGroup>
<PropertyGroup>
<DotnetRuntimeVersion Condition="'$(DotnetRuntimeVersion)' == ''">default</DotnetRuntimeVersion>
+ <PrivateBuildTesting Condition="'$(PrivateBuildTesting)' == ''">false</PrivateBuildTesting>
<InternalReleaseTesting>false</InternalReleaseTesting>
<InternalReleaseTesting Condition="'$(DotnetRuntimeVersion)' != 'default'">true</InternalReleaseTesting>
<ExtraInstallArgs>-runtimesourcefeed '$(RuntimeSourceFeed)' -runtimesourcefeedkey '$(RuntimeSourceFeedKey)'</ExtraInstallArgs>
</PropertyGroup>
- <ItemGroup Condition="!$(InternalReleaseTesting)">
+ <ItemGroup Condition="!$(PrivateBuildTesting) AND !$(InternalReleaseTesting)">
<RuntimeTestVersions Include="Latest">
<RuntimeDownload>$(VSRedistCommonNetCoreSharedFrameworkx6490Version)</RuntimeDownload>
<Runtime>$(MicrosoftNETCoreAppRuntimewinx64Version)</Runtime>
<TargetFramework>net6.0</TargetFramework>
</RuntimeTestVersions>
</ItemGroup>
+ <!-- Private build testing -->
+ <ItemGroup Condition="$(PrivateBuildTesting)">
+ <RuntimeTestVersions Include="Latest">
+ <RuntimeDownload>$(VSRedistCommonNetCoreSharedFrameworkx6490Version)</RuntimeDownload>
+ <Runtime>$(MicrosoftNETCoreAppRuntimewinx64Version)</Runtime>
+ <AspNetDownload>$(MicrosoftAspNetCoreAppRefInternalVersion)</AspNetDownload>
+ <AspNet>$(MicrosoftAspNetCoreAppRefVersion)</AspNet>
+ <TargetFramework>net9.0</TargetFramework>
+ </RuntimeTestVersions>
+ </ItemGroup>
<!-- Internal service release testing -->
<ItemGroup Condition="$(InternalReleaseTesting)">
<RuntimeTestVersions Include="Latest" Condition="'$(DotnetRuntimeDownloadVersion)' != 'default'">
[ValidateSet("Debug","Release")][string][Alias('c')] $configuration = "Debug",
[string][Alias('v')] $verbosity = "minimal",
[switch][Alias('t')] $test,
+ [switch] $installruntimes,
+ [switch] $privatebuild,
[switch] $ci,
[switch] $skipmanaged,
[switch] $skipnative,
}
}
+if ($installruntimes -or $privatebuild) {
+ $privatebuildtesting = "false"
+ if ($privatebuild) {
+ $privatebuildtesting = "true"
+ }
+ Remove-Item -Force -Recurse -ErrorAction SilentlyContinue "$reporoot\.dotnet-test"
+ & "$engroot\common\msbuild.ps1" `
+ $engroot\InstallRuntimes.proj `
+ -verbosity $verbosity `
+ /t:InstallTestRuntimes `
+ /bl:$logdir\InstallRuntimes.binlog `
+ /p:PrivateBuildTesting=$privatebuildtesting `
+ /p:BuildArch=$architecture `
+ /p:TestArchitectures=$architecture
+}
+
# Run the xunit tests
if ($test) {
if (-not $crossbuild) {
__RuntimeSourceFeedKey=
__SkipConfigure=0
__SkipGenerateVersion=0
+__InstallRuntimes=0
+__PrivateBuild=0
__Test=0
__UnprocessedBuildArgs=
__NativeBuild=0
;;
+ installruntimes|-installruntimes)
+ __InstallRuntimes=1
+ ;;
+
+ privatebuild|-privatebuild)
+ __PrivateBuild=1
+ ;;
+
test|-test)
__Test=1
;;
echo "Copied SOS to $__dotnet_dump"
fi
+#
+# Install test runtimes and set up for private runtime build
+#
+
+if [[ "$__InstallRuntimes" == 1 || "$__PrivateBuild" == 1 ]]; then
+ __privateBuildTesting=false
+ if [[ "$__PrivateBuild" == 1 ]]; then
+ __privateBuildTesting=true
+ fi
+ rm -fr "$__RepoRootDir/.dotnet-test" || true
+ "$__RepoRootDir/eng/common/msbuild.sh" \
+ $__RepoRootDir/eng/InstallRuntimes.proj \
+ /t:InstallTestRuntimes \
+ /bl:"$__LogsDir/InstallRuntimes.binlog" \
+ /p:PrivateBuildTesting="$__privateBuildTesting" \
+ /p:BuildArch="$__TargetArch" \
+ /p:TestArchitectures="$__TargetArch"
+fi
+
#
# Run xunit tests
#
+++ /dev/null
-<Project Sdk="Microsoft.NET.Sdk">
-
- <!-- This project exists purely to work around Arcade
- behavior. Arcade knows how to restore tasks needed for
- publishing to blob feeds, but it requires a project file that
- imports nuget restore targets to be specified for this to
- work. See details in
- https://github.com/dotnet/arcade/commit/f657be5cb7cd4920334dd9162173b131211a1e17#r31728598.
- -->
-
- <PropertyGroup>
- <TargetFramework>net6.0</TargetFramework>
- </PropertyGroup>
-
- <Import Project="versioning.targets" />
-
-</Project>
--- /dev/null
+@echo off
+powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" -installruntimes -skipmanaged -skipnative %*"
+exit /b %ErrorLevel%
--- /dev/null
+#!/usr/bin/env bash
+
+source="${BASH_SOURCE[0]}"
+
+# resolve $SOURCE until the file is no longer a symlink
+while [[ -h $source ]]; do
+ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+ source="$(readlink "$source")"
+
+ # if $source was a relative symlink, we need to resolve it relative to the path where the
+ # symlink file was located
+ [[ $source != /* ]] && source="$scriptroot/$source"
+done
+
+scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+"$scriptroot/../eng/build.sh" -installruntimes -skipmanaged -skipnative $@
+
--- /dev/null
+@echo off
+powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0build.ps1""" -privatebuild -skipmanaged -skipnative %*"
+exit /b %ErrorLevel%
--- /dev/null
+#!/usr/bin/env bash
+
+source="${BASH_SOURCE[0]}"
+
+# resolve $SOURCE until the file is no longer a symlink
+while [[ -h $source ]]; do
+ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+ source="$(readlink "$source")"
+
+ # if $source was a relative symlink, we need to resolve it relative to the path where the
+ # symlink file was located
+ [[ $source != /* ]] && source="$scriptroot/$source"
+done
+
+scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+"$scriptroot/../eng/build.sh" -privatebuild -skipmanaged -skipnative $@
--- /dev/null
+%~dp0..\.dotnet\dotnet.exe test --no-build --logger "console;verbosity=detailed" %~dp0..\src\SOS\SOS.UnitTests\SOS.UnitTests.csproj
--- /dev/null
+#!/usr/bin/env bash
+
+source="${BASH_SOURCE[0]}"
+
+# resolve $SOURCE until the file is no longer a symlink
+while [[ -h $source ]]; do
+ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+ source="$(readlink "$source")"
+
+ # if $source was a relative symlink, we need to resolve it relative to the path where the
+ # symlink file was located
+ [[ $source != /* ]] && source="$scriptroot/$source"
+done
+
+scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
+export LLDB_PATH=/usr/bin/lldb
+$scriptroot/../.dotnet/dotnet test --no-build --logger "console;verbosity=detailed" $scriptroot/../src/SOS/SOS.UnitTests/SOS.UnitTests.csproj
private const string DebugTypeKey = "DebugType";
private const string DebuggeeBuildRootKey = "DebuggeeBuildRoot";
+ public static TestConfiguration Empty { get; } = new TestConfiguration();
+
public static string BaseDir { get; set; } = Path.GetFullPath(".");
private static readonly Regex versionRegex = new(@"^(\d+\.\d+\.\d+)(-.*)?", RegexOptions.Compiled);
}
}
- public IReadOnlyDictionary<string, string> AllSettings
- {
- get { return _settings; }
- }
+ public bool IsEmpty => _settings.Count == 0;
+
+ public IReadOnlyDictionary<string, string> AllSettings => _settings;
/// <summary>
/// Creates a new test config with the new PDB type (full, portable or embedded)
<TestWebApp3>true</TestWebApp3>
<TestWebApp3 Condition="'$(InternalReleaseTesting)' == 'true'">false</TestWebApp3>
+ <TestSingleFile>true</TestSingleFile>
+ <TestSingleFile Condition="'$(PrivateBuildTesting)' == 'true'">false</TestSingleFile>
+
<DebuggeeSourceRoot>$(RepoRootDir)/src/SOS/SOS.UnitTests/Debuggees</DebuggeeSourceRoot>
<DebuggeeMsbuildAuxRoot>$(RepoRootDir)/eng/AuxMsbuildFiles</DebuggeeMsbuildAuxRoot>
<DebuggeeBuildProcess>sdk.prebuilt</DebuggeeBuildProcess>
<!--
Single file (debuggees cli built)
-->
- <Option Condition="'$(RuntimeVersionLatest)' != ''">
- <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
- <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing1)' != ''">
- <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
- <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing1)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing2)' != ''">
- <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
- <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing2)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing3)' != ''">
- <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
- <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing3)</RuntimeFrameworkVersion>
+ <Option Condition="'$(TestSingleFile)' == 'true'">
+ <Options>
+ <Option Condition="'$(RuntimeVersionLatest)' != ''">
+ <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+ <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing1)' != ''">
+ <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+ <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing1)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing2)' != ''">
+ <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+ <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing2)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing3)' != ''">
+ <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+ <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing3)</RuntimeFrameworkVersion>
+ </Option>
+ </Options>
</Option>
<!--
Default (prebuilt)
<DebuggeeBuildRoot>$(RootBinDir)/Debuggees</DebuggeeBuildRoot>
<TestName>SOS.StackAndOtherTests</TestName>
<Options>
- <Option Condition="'$(RuntimeVersionLatest)' != ''">
- <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing1)' != ''">
- <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing1)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing2)' != ''">
- <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing2)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing3)' != ''">
- <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing3)</RuntimeFrameworkVersion>
+ <Option Condition="'$(TestSingleFile)' == 'true'">
+ <Options>
+ <Option Condition="'$(RuntimeVersionLatest)' != ''">
+ <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing1)' != ''">
+ <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing1)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing2)' != ''">
+ <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing2)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing3)' != ''">
+ <DebuggeeBuildRoot>$(RootBinDir)/Debuggees/SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing3)</RuntimeFrameworkVersion>
+ </Option>
+ </Options>
</Option>
<Option Condition="'$(RuntimeVersionLatest)' != ''">
<RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
<TestWebApp3 Condition="'$(InternalReleaseTesting)' == 'true'">false</TestWebApp3>
<TestDesktop>true</TestDesktop>
+ <TestDesktop Condition="'$(PrivateBuildTesting)' == 'true'">false</TestDesktop>
<TestDesktop Condition="'$(InternalReleaseTesting)' == 'true'">false</TestDesktop>
<TestDesktop Condition="'$(TargetArchitecture)' == 'arm64'">false</TestDesktop>
+ <TestSingleFile>true</TestSingleFile>
+ <TestSingleFile Condition="'$(PrivateBuildTesting)' == 'true'">false</TestSingleFile>
+
<DesktopFrameworkPath Condition="$(TargetArchitecture) == x64">$(WinDir)\Microsoft.Net\Framework64\v4.0.30319\</DesktopFrameworkPath>
<DesktopFrameworkPath Condition="$(TargetArchitecture) != x64">$(WinDir)\Microsoft.Net\Framework\v4.0.30319\</DesktopFrameworkPath>
<DesktopFramework>net462</DesktopFramework>
<!--
Single file (debuggees cli built)
-->
- <Option Condition="'$(RuntimeVersionLatest)' != ''">
- <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
- <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing1)' != ''">
- <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
- <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing1)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing2)' != ''">
- <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
- <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing2)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing3)' != ''">
- <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
- <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing3)</RuntimeFrameworkVersion>
+ <Option Condition="'$(TestSingleFile)' == 'true'">
+ <Options>
+ <Option Condition="'$(RuntimeVersionLatest)' != ''">
+ <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+ <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing1)' != ''">
+ <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+ <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing1)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing2)' != ''">
+ <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+ <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing2)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing3)' != ''">
+ <DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
+ <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing3)</RuntimeFrameworkVersion>
+ </Option>
+ </Options>
</Option>
<!--
Default (prebuilt)
<DebuggeeBuildRoot>$(RootBinDir)\Debuggees</DebuggeeBuildRoot>
<TestName>SOS.StackAndOtherTests</TestName>
<Options>
- <Option Condition="'$(RuntimeVersionLatest)' != ''">
- <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing1)' != ''">
- <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing1)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing2)' != ''">
- <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing2)</RuntimeFrameworkVersion>
- </Option>
- <Option Condition="'$(RuntimeVersionServicing3)' != ''">
- <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
- <PublishSingleFile>true</PublishSingleFile>
- <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- <RuntimeFrameworkVersion>$(RuntimeVersionServicing3)</RuntimeFrameworkVersion>
+ <Option Condition="'$(TestSingleFile)' == 'true'">
+ <Options>
+ <Option Condition="'$(RuntimeVersionLatest)' != ''">
+ <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing1)' != ''">
+ <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing1)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing2)' != ''">
+ <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing2)</RuntimeFrameworkVersion>
+ </Option>
+ <Option Condition="'$(RuntimeVersionServicing3)' != ''">
+ <DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
+ <PublishSingleFile>true</PublishSingleFile>
+ <BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
+ <RuntimeFrameworkVersion>$(RuntimeVersionServicing3)</RuntimeFrameworkVersion>
+ </Option>
+ </Options>
</Option>
<Option Condition="'$(RuntimeVersionLatest)' != ''">
<RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
</Option>
</Options>
<Options>
- <Option Condition="'$(RuntimeLatestVersion)' != ''">
+ <TestWebApp3_SingleFile>true</TestWebApp3_SingleFile>
+ <TestWebApp3_SingleFile Condition="'$(TestSingleFile)' == 'true'">false</TestWebApp3_SingleFile>
+ <TestWebApp3_SingleFile Condition="'$(RuntimeLatestVersion)' == ''">false</TestWebApp3_SingleFile>
+ <Option Condition="'$(TestWebApp3_SingleFile)' == 'true'">
<DebuggeeBuildProcess>cli</DebuggeeBuildProcess>
<DebuggeeBuildRoot>$(RootBinDir)\Debuggees\SingleFile</DebuggeeBuildRoot>
<RuntimeFrameworkVersion>$(RuntimeLatestVersion)</RuntimeFrameworkVersion>
<PublishSingleFile>true</PublishSingleFile>
<BuildProjectRuntime>$(TargetRid)</BuildProjectRuntime>
- </Option>
+ </Option>
<Option Condition="'$(AspNetCoreVersionLatest)' != ''">
<RuntimeFrameworkVersion>$(RuntimeVersionLatest)</RuntimeFrameworkVersion>
<!-- This turns off the -fx-version to the dotnet host allowing it use the correct runtime version -->
{
public static IEnumerable<object[]> GetConfigurations(string key, string value)
{
- return TestRunConfiguration.Instance.Configurations.Where((c) => key == null || c.AllSettings.GetValueOrDefault(key) == value).Select(c => new[] { c });
+ return TestRunConfiguration.Instance.Configurations.Where((c) => key == null || c.AllSettings.GetValueOrDefault(key) == value).DefaultIfEmpty(TestConfiguration.Empty).Select(c => new[] { c });
}
internal static void SkipIfArm(TestConfiguration config)
UsePipeSync = true,
DumpGenerator = SOSRunner.DumpGenerator.DotNetDump
},
- Output);
+ Output);
}
[SkippableTheory, MemberData(nameof(SOSTestHelpers.GetConfigurations), "TestName", "SOS.DualRuntimes", MemberType = typeof(SOSTestHelpers))]
public async Task DualRuntimes(TestConfiguration config)
{
+ // This test on linux/macOS can be called with an empty config because vstest and dotnet test fail/complain about no test parameters. The
+ // linux/macOS config file doesn't contain a SOS.DualRuntimes TestName because this is Windows only.
+ if (config.IsEmpty)
+ {
+ throw new SkipTestException("Skipping DualRuntimes test");
+ }
if (config.PublishSingleFile)
{
throw new SkipTestException("Single file not supported");
SOSCOMMAND:DumpObj <PREVPOUT>
VERIFY:\s*Name:\s+GCWhere\s+
VERIFY:\s+MethodTable:\s+<HEXVAL>\s+
-VERIFY:\s+EEClass:\s+<HEXVAL>\s+
+VERIFY:\s+(EEClass|Canonical MethodTable):\s+<HEXVAL>\s+
VERIFY:\s+Fields:\s+
VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+System\.String.*_string\s+
VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+System\.UInt64.*52704621242434 _static\s+
SOSCOMMAND:DumpObj -nofields <PREVPOUT>
VERIFY:\s*Name:\s+GCWhere\s+
VERIFY:\s+MethodTable:\s+<HEXVAL>\s+
-VERIFY:\s+EEClass:\s+<HEXVAL>\s+
+VERIFY:\s+(EEClass|Canonical MethodTable):\s+<HEXVAL>\s+
SOSCOMMAND:DumpObj -refs <PREVPOUT>
VERIFY:\s*Name:\s+GCWhere\s+
VERIFY:\s+MethodTable:\s+<HEXVAL>\s+
-VERIFY:\s+EEClass:\s+<HEXVAL>\s+
+VERIFY:\s+(EEClass|Canonical MethodTable):\s+<HEXVAL>\s+
VERIFY:\s+Fields:\s+
VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+System\.String.*_string\s+
VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+System\.UInt64.*52704621242434 _static\s+
SOSCOMMAND:DumpObj <PREVPOUT>
VERIFY:\s*Name:\s+GCWhere\s+
VERIFY:\s+MethodTable:\s+<HEXVAL>\s+
-VERIFY:\s+EEClass:\s+<HEXVAL>\s+
+VERIFY:\s+(EEClass|Canonical MethodTable):\s+<HEXVAL>\s+
VERIFY:\s+Fields:\s+
VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+System\.String.*_string\s+
VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+System\.UInt64.*52704621242434 _static\s+
SOSCOMMAND:DumpObj -nofields <PREVPOUT>
VERIFY:\s*Name:\s+GCWhere\s+
VERIFY:\s+MethodTable:\s+<HEXVAL>\s+
-VERIFY:\s+EEClass:\s+<HEXVAL>\s+
+VERIFY:\s+(EEClass|Canonical MethodTable):\s+<HEXVAL>\s+
SOSCOMMAND:DumpObj -refs <PREVPOUT>
VERIFY:\s*Name:\s+GCWhere\s+
VERIFY:\s+MethodTable:\s+<HEXVAL>\s+
-VERIFY:\s+EEClass:\s+<HEXVAL>\s+
+VERIFY:\s+(EEClass|Canonical MethodTable):\s+<HEXVAL>\s+
VERIFY:\s+Fields:\s+
VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+System\.String.*_string\s+
VERIFY:\s+<HEXVAL>\s+<HEXVAL>\s+<HEXVAL>\s+System\.UInt64.*52704621242434 _static\s+