-
Notifications
You must be signed in to change notification settings - Fork 341
Honor --arch switch for arm64 on Windows and Mac
#3100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 27 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
3ebcdaa
add first version of muxer finder
MarcoRossignoli 792b981
add X64 force scenarios
MarcoRossignoli e3047e2
refactor DotnetHostHelper
MarcoRossignoli fb54a0e
add validation matrix
MarcoRossignoli 735569b
move internal helper to internal visibility
MarcoRossignoli fa12d56
force to x64 only if user doesn't specify nothing, refactor arch/fx m…
MarcoRossignoli e4e9958
make RunsettingsHelper testable
MarcoRossignoli 47da915
temporary fix issue with ARM64 metadata detection, add architecture i…
MarcoRossignoli 6c09164
address PR feedback
MarcoRossignoli eebc3c1
fix architecture infer for asm, add Mac-O reader, update dotnet host …
MarcoRossignoli 5cd221b
keep back compat in assembly metadata provider
MarcoRossignoli 9fabfee
refactor dotnet host helper, improve error notification
MarcoRossignoli 3da05df
use invariant culture api
MarcoRossignoli 9090dcf
first part of update for win arm, run always with dotnet muxer and av…
MarcoRossignoli 2dcbd9f
remove testhost.dll override from package for x64, refactor searching…
MarcoRossignoli df68b83
skip apphost host on arm/win, flow new sdk VSTEST_WINAPPHOST_ to app …
MarcoRossignoli 16f3457
add VSTEST_TMP_SWITCH_DOTNETROOTS_ENVVARS env var for manual testability
MarcoRossignoli 412d0b3
fix PlatformArgumentProcessorTests UTs
MarcoRossignoli b7275e1
fix unix build
MarcoRossignoli 459f93b
use AnyCPU version of testhost.dll in case of x64
MarcoRossignoli b3fc02c
remove arch/framework check and let test fail
MarcoRossignoli 0001463
move acceptance RunMultipleTestAssembliesInParallel to win only
MarcoRossignoli 73dc606
fix comment typo
MarcoRossignoli 056e239
Update message for muxer not found
MarcoRossignoli 097198e
Improve error message in case of x64 forcing.
MarcoRossignoli e13896f
address Vitek feedback, refactor host manager
MarcoRossignoli 704266e
nit cleanup
MarcoRossignoli 0e007d0
address PR feedback
MarcoRossignoli 0ec501e
return current running muxer if SDK and target architecture are the same
MarcoRossignoli 52e120e
Improve logging
MarcoRossignoli 47e268a
add UTs DotnetHostHelper env vars
MarcoRossignoli 9d7976a
Add UTs for windows global registraton
MarcoRossignoli 9d363b8
complete DotnetHostHelper UTs
MarcoRossignoli 72a178a
Improve DotnetHostHelper UTs
MarcoRossignoli 35dbef9
Run GetDotnetPathByArchitecture_DefaultInstallation_Win only on win d…
MarcoRossignoli 8e048e8
Add UTs for apphost DOTNET_ROOTS forwarding
MarcoRossignoli a48edc2
Cleanup
MarcoRossignoli cbc247d
Apply suggestions from code review
MarcoRossignoli 73b2a23
address Jakub feedback
MarcoRossignoli bcf4bbf
fix UTs
MarcoRossignoli 37bfa5e
revert platform BC
MarcoRossignoli 041b1f2
revert public api BC
MarcoRossignoli 4d1c3e0
restore InitializeShouldNotConsiderCaseSensitivityOfTheArgumentPassed UT
MarcoRossignoli dea3414
fix documentation
MarcoRossignoli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
357 changes: 353 additions & 4 deletions
357
src/Microsoft.TestPlatform.CoreUtilities/Helpers/DotnetHostHelper.cs
Large diffs are not rendered by default.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
src/Microsoft.TestPlatform.CoreUtilities/Helpers/EnvironmentVariableHelper.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
| #if !NETSTANDARD1_0 | ||
|
|
||
| using System; | ||
| using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces; | ||
|
|
||
| namespace Microsoft.VisualStudio.TestPlatform.CoreUtilities.Helpers | ||
| { | ||
| internal class EnvironmentVariableHelper : IEnvironmentVariableHelper | ||
| { | ||
| public string GetEnvironmentVariable(string variable) | ||
| => Environment.GetEnvironmentVariable(variable); | ||
| } | ||
| } | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IEnvironmentVariableHelper.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
| namespace Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces | ||
| { | ||
| internal interface IEnvironmentVariableHelper | ||
| { | ||
| string GetEnvironmentVariable(string variable); | ||
| } | ||
| } |
10 changes: 10 additions & 0 deletions
10
src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IRunsettingsHelper.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
| namespace Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces | ||
| { | ||
| internal interface IRunSettingsHelper | ||
| { | ||
| bool IsDefaultTargetArchitecture { get; set; } | ||
| } | ||
| } |
27 changes: 27 additions & 0 deletions
27
src/Microsoft.TestPlatform.CoreUtilities/Helpers/Interfaces/IWindowsRegistryHelper.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
|
|
||
| #if !NETSTANDARD1_0 | ||
|
|
||
| using System; | ||
| using Microsoft.Win32; | ||
|
|
||
| namespace Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces | ||
| { | ||
| internal interface IWindowsRegistryHelper | ||
| { | ||
| IRegistryKey OpenBaseKey(RegistryHive hKey, RegistryView view); | ||
| } | ||
|
|
||
| internal interface IRegistryKey : IDisposable | ||
| { | ||
| IRegistryKey OpenSubKey(string name); | ||
|
|
||
| object GetValue(string name); | ||
|
|
||
| string[] GetSubKeyNames(); | ||
| } | ||
| } | ||
|
|
||
| #endif |
23 changes: 23 additions & 0 deletions
23
src/Microsoft.TestPlatform.CoreUtilities/Helpers/RunSettingsHelper.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
| using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces; | ||
|
|
||
| namespace Microsoft.VisualStudio.TestPlatform.Utilities.Helpers | ||
| { | ||
| /// <summary> | ||
| /// RunSettingsHelper is used to globally share additional informations about the state of run settings. | ||
| /// </summary> | ||
| internal class RunSettingsHelper : IRunSettingsHelper | ||
| { | ||
| private static IRunSettingsHelper runSettings = new RunSettingsHelper(); | ||
|
|
||
| public static IRunSettingsHelper Instance = runSettings; | ||
|
|
||
| /// <summary> | ||
| /// If false user updated the RunConfiguration.TargetPlatform using | ||
| /// --arch or runsettings file or -- RunConfiguration.TargetPlatform=arch | ||
| /// </summary> | ||
| public bool IsDefaultTargetArchitecture { get; set; } = true; | ||
| } | ||
| } |
50 changes: 50 additions & 0 deletions
50
src/Microsoft.TestPlatform.CoreUtilities/Helpers/WindowsRegistryHelper.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
|
||
| #if !NETSTANDARD1_0 | ||
|
|
||
| using Microsoft.VisualStudio.TestPlatform.Utilities.Helpers.Interfaces; | ||
| using Microsoft.Win32; | ||
|
|
||
| namespace Microsoft.VisualStudio.TestPlatform.Utilities.Helpers | ||
| { | ||
| internal class WindowsRegistryHelper : IWindowsRegistryHelper | ||
| { | ||
| public IRegistryKey OpenBaseKey(RegistryHive hKey, RegistryView view) | ||
| { | ||
| var keyRegistry = RegistryKey.OpenBaseKey(hKey, view); | ||
| return keyRegistry is null ? null : new RegistryKeyWrapper(keyRegistry); | ||
| } | ||
| } | ||
|
|
||
| internal class RegistryKeyWrapper : IRegistryKey | ||
| { | ||
| private readonly RegistryKey registryKey; | ||
|
|
||
| public RegistryKeyWrapper(RegistryKey registryKey) | ||
| { | ||
| this.registryKey = registryKey; | ||
| } | ||
|
|
||
| public object GetValue(string name) | ||
| { | ||
| return registryKey?.GetValue(name)?.ToString(); | ||
| } | ||
|
|
||
| public IRegistryKey OpenSubKey(string name) | ||
| { | ||
| var keyRegistry = this.registryKey.OpenSubKey(name); | ||
| return keyRegistry is null ? null : new RegistryKeyWrapper(keyRegistry); | ||
| } | ||
|
|
||
| public string[] GetSubKeyNames() | ||
| => this.registryKey?.GetSubKeyNames(); | ||
|
|
||
| public void Dispose() | ||
| { | ||
| this.registryKey?.Dispose(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.