From cc3c3e90a867472aea64834ef8f5fabaf84e36e8 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 9 Jul 2020 14:09:33 +0300 Subject: [PATCH 1/4] [wasm] Modify System.Net.NetworkInformation to throw PNSE --- .../src/Resources/Strings.resx | 3 +++ .../src/System.Net.NetworkInformation.csproj | 16 ++++++++++------ .../tests/FunctionalTests/AssemblyInfo.cs | 6 ++++++ ...et.NetworkInformation.Functional.Tests.csproj | 1 + src/libraries/tests.proj | 1 - 5 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/AssemblyInfo.cs diff --git a/src/libraries/System.Net.NetworkInformation/src/Resources/Strings.resx b/src/libraries/System.Net.NetworkInformation/src/Resources/Strings.resx index aec53b733bd31a..3f86a8ff7d6289 100644 --- a/src/libraries/System.Net.NetworkInformation/src/Resources/Strings.resx +++ b/src/libraries/System.Net.NetworkInformation/src/Resources/Strings.resx @@ -90,4 +90,7 @@ An error was encountered while querying information from the operating system. + + System.Net.NetworkInformation is not supported on this platform. + diff --git a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj index ff314febcb2344..5ecd3a93092865 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj +++ b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj @@ -5,8 +5,12 @@ true $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD enable + $(NoWarn);nullable - + + SR.net_NetworkInformation_PlatformNotSupported + + @@ -122,7 +126,7 @@ Link="Common\Interop\Windows\WinSock\Interop.WSAIoctl.cs" /> - + @@ -154,7 +158,7 @@ Link="Common\System\IO\RowConfigReader.cs" /> - + @@ -221,7 +225,7 @@ - + @@ -248,11 +252,11 @@ - + - + diff --git a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/AssemblyInfo.cs b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/AssemblyInfo.cs new file mode 100644 index 00000000000000..82a863731002f6 --- /dev/null +++ b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Xunit; + +[assembly: SkipOnMono("System.Net.NetworkInformation is not supported on wasm", TestPlatforms.Browser)] diff --git a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/System.Net.NetworkInformation.Functional.Tests.csproj b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/System.Net.NetworkInformation.Functional.Tests.csproj index f9b964b19b5dac..e20c69af266c34 100644 --- a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/System.Net.NetworkInformation.Functional.Tests.csproj +++ b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/System.Net.NetworkInformation.Functional.Tests.csproj @@ -5,6 +5,7 @@ $(NetCoreAppCurrent) + diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 540ec8a56987cf..e8706317765378 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -22,7 +22,6 @@ - From 8145efbab6a37876e614902a44aa91ceab8613d9 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 9 Jul 2020 16:05:50 +0300 Subject: [PATCH 2/4] Disable a couple of S.R.S.Formatters tests due to PNSE on wasm --- .../tests/BinaryFormatterTests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs b/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs index a8557d7a6bcd14..bdcf0e4f1a6dbc 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs @@ -49,6 +49,7 @@ public void SerializeHugeObjectGraphs(int limit) [SkipOnCoreClr("Takes too long on Checked", RuntimeConfiguration.Checked)] [ActiveIssue("https://github.com/dotnet/runtime/issues/34008", TestPlatforms.Linux, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtime/issues/34753", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [PlatformSpecific(~TestPlatforms.Browser)] [MemberData(nameof(BasicObjectsRoundtrip_MemberData))] public void ValidateBasicObjectsRoundtrip(object obj, FormatterAssemblyStyle assemblyFormat, TypeFilterLevel filterLevel, FormatterTypeStyle typeFormat) { @@ -187,6 +188,7 @@ public void ValidateDeserializationOfObjectWithGenericTypeWhichGenericArgumentHa [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/34008", TestPlatforms.Linux, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtime/issues/34753", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [PlatformSpecific(~TestPlatforms.Browser)] public void RoundtripManyObjectsInOneStream() { object[][] objects = SerializableObjects_MemberData().ToArray(); From 0cc491bfbd7fb2475b7f40914487136a4119cc2e Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 9 Jul 2020 22:26:15 +0300 Subject: [PATCH 3/4] Remove NoWarn --- .../src/System.Net.NetworkInformation.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj index 5ecd3a93092865..6bacb445758d9f 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj +++ b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj @@ -5,7 +5,6 @@ true $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD enable - $(NoWarn);nullable SR.net_NetworkInformation_PlatformNotSupported From 269bf9c7752de03224ee42dd90c086d1a76ea9f1 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Fri, 10 Jul 2020 09:32:06 +0300 Subject: [PATCH 4/4] Address the feedback --- .../src/System.Net.NetworkInformation.csproj | 4 ++-- .../System.Net.NetworkInformation.Functional.Tests.csproj | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj index 6bacb445758d9f..eb471d9c6b4c9e 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj +++ b/src/libraries/System.Net.NetworkInformation/src/System.Net.NetworkInformation.csproj @@ -125,7 +125,7 @@ Link="Common\Interop\Windows\WinSock\Interop.WSAIoctl.cs" /> - + @@ -251,7 +251,7 @@ - + diff --git a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/System.Net.NetworkInformation.Functional.Tests.csproj b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/System.Net.NetworkInformation.Functional.Tests.csproj index e20c69af266c34..823110a4403ca5 100644 --- a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/System.Net.NetworkInformation.Functional.Tests.csproj +++ b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/System.Net.NetworkInformation.Functional.Tests.csproj @@ -3,6 +3,7 @@ true ../../src/Resources/Strings.resx $(NetCoreAppCurrent) + true