From: Paulo Janotti Date: Sat, 19 May 2018 04:31:31 +0000 (-0700) Subject: Disable serial ports tests on Windows Nano (dotnet/corefx#29793) X-Git-Tag: submit/tizen/20210909.063632~11031^2~4407 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55a5d7e355ea13b72492ce430ba029af0e96174e;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Disable serial ports tests on Windows Nano (dotnet/corefx#29793) Fix dotnet/corefx#29756 Commit migrated from https://github.com/dotnet/corefx/commit/70959b289ae72f04ad36853cf17c7262fda4ef6b --- diff --git a/src/libraries/System.IO.Ports/tests/SerialPort/GetPortNames.cs b/src/libraries/System.IO.Ports/tests/SerialPort/GetPortNames.cs index 7439ec0..d46ac8d 100644 --- a/src/libraries/System.IO.Ports/tests/SerialPort/GetPortNames.cs +++ b/src/libraries/System.IO.Ports/tests/SerialPort/GetPortNames.cs @@ -19,7 +19,7 @@ namespace System.IO.Ports.Tests /// /// Check that all ports either open correctly or fail with UnauthorizedAccessException (which implies they're already open) /// - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] private void OpenEveryPortName() { foreach (string portName in SerialPort.GetPortNames()) @@ -40,7 +40,7 @@ namespace System.IO.Ports.Tests /// Test that SerialPort.GetPortNames finds every port that the test helpers have found. /// (On Windows, the latter uses a different technique to SerialPort to find ports). /// - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] private void AllHelperPortsAreInGetPortNames() { string[] serialPortNames = SerialPort.GetPortNames(); @@ -55,7 +55,7 @@ namespace System.IO.Ports.Tests /// Test that the test helpers have found every port that SerialPort.GetPortNames has found /// This catches regressions in the test helpers, eg GH #18928 / #20668 /// - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] private void AllGetPortNamesAreInHelperPorts() { string[] helperPortNames = PortHelper.GetPorts(); diff --git a/src/libraries/System.IO.Ports/tests/Support/TCSupport.cs b/src/libraries/System.IO.Ports/tests/Support/TCSupport.cs index ce3448c..43b4c9b 100644 --- a/src/libraries/System.IO.Ports/tests/Support/TCSupport.cs +++ b/src/libraries/System.IO.Ports/tests/Support/TCSupport.cs @@ -32,6 +32,12 @@ namespace Legacy.Support private static void InitializeSerialInfo() { + if (PlatformDetection.IsWindowsNanoServer) + { + s_localMachineSerialPortRequirements = SerialPortRequirements.None; + return; + } + GenerateSerialInfo(); if (s_localMachineSerialInfo.LoopbackPortName != null)