Add dotnet test device selection support for MAUI#54295
Draft
jonathanpeppers wants to merge 1 commit into
Draft
Conversation
17 tasks
Update dotnet-run-for-maui.md spec with dotnet test behavior section. Add --device and --interactive options to dotnet test (MTP path). When --device is specified without -f, prompt for target framework selection since devices are platform-specific. For each TFM, check for ComputeAvailableDevices target and use RunCommandSelector to handle device selection (auto-select single device, error in non-interactive mode with multiple devices). Includes DotnetTestDevices test asset and 7 integration tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
9e813f8 to
0dfbb74
Compare
This was referenced May 15, 2026
Open
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds
--deviceand--interactiveoptions todotnet test(MTP path) for .NET MAUI projects, enabling per-target-framework device selection.Behavior
dotnet testiterates all target frameworks without prompting (existing behavior unchanged)ComputeAvailableDevicestarget exists, usesRunCommandSelectorto handle device selection--device: When specified without-f, forces a target framework prompt since devices are platform-specificChanges
TestCommandDefinition.MicrosoftTestingPlatform.cs— AddedDeviceOptionandInteractiveOptionOptions.cs/MSBuildUtility.cs—DeviceandIsInteractiveonBuildOptionsMicrosoftTestingPlatformTestCommand.cs—HandleDeviceWithTargetFrameworkSelection()for--device+ TF selectionSolutionAndProjectUtility.cs—TrySelectDeviceForProject()called per-TFM before running testsdotnet-run-for-maui.md— Updated spec withdotnet testbehavior sectionTests
7 integration tests in
GivenDotnetTestSelectsDevicecovering:--devicein non-interactive mode-f+--deviceComputeAvailableDevicestarget