From 33a7a32184464f696db2bf8b52b3453874e03c3d Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Wed, 31 Mar 2021 17:27:57 -0400 Subject: [PATCH 01/51] Bring up Android device aot on ci Addresses https://github.com/dotnet/runtime/issues/33381 --- eng/pipelines/runtime-staging.yml | 39 +++++++++++++++++++++++++++++++ src/libraries/tests.proj | 8 ++++++- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml index c5fedb7b00e025..43d4c394331079 100644 --- a/eng/pipelines/runtime-staging.yml +++ b/eng/pipelines/runtime-staging.yml @@ -95,6 +95,45 @@ jobs: eq(variables['monoContainsChange'], true), eq(variables['isFullMatrix'], true)) +# +# Build the whole product using Mono and run libraries tests +# +- template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/common/global-build-job.yml + helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml + buildConfig: Release + runtimeFlavor: mono + platforms: + - Android_arm64 + variables: + # map dependencies variables to local variables + - name: librariesContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ] + - name: monoContainsChange + value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ] + jobParameters: + testGroup: innerloop + nameSuffix: AllSubsets_AOT_Mono + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunDisabledAndroidTests=true /p:RunAOTCompilation=true + timeoutInMinutes: 210 + condition: >- + or( + eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true), + eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true), + eq(variables['isFullMatrix'], true)) + # extra steps, run tests + extraStepsTemplate: /eng/pipelines/libraries/helix.yml + extraStepsParameters: + creator: dotnet-bot + testRunNamePrefixSuffix: Mono_$(_BuildConfig) + condition: >- + or( + eq(variables['librariesContainsChange'], true), + eq(variables['monoContainsChange'], true), + eq(variables['isFullMatrix'], true)) + - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/common/global-build-job.yml diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 1442c9d3020fca..74ab4b8d875a23 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -68,6 +68,11 @@ + + + + + @@ -360,7 +365,7 @@ BuildInParallel="false" /> @@ -368,6 +373,7 @@ From 01adef826a4f3bd6afad8aa0cdfe1ac526acad20 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Thu, 1 Apr 2021 09:46:57 -0400 Subject: [PATCH 02/51] Bump the aot timeout to see how long it really takes --- eng/pipelines/runtime-staging.yml | 2 +- src/tasks/AotCompilerTask/MonoAOTCompiler.props | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml index 41aa826a59ce5c..322242a2e39e68 100644 --- a/eng/pipelines/runtime-staging.yml +++ b/eng/pipelines/runtime-staging.yml @@ -117,7 +117,7 @@ jobs: testGroup: innerloop nameSuffix: AllSubsets_AOT_Mono buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunDisabledAndroidTests=true /p:RunAOTCompilation=true - timeoutInMinutes: 210 + timeoutInMinutes: 580 condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.props b/src/tasks/AotCompilerTask/MonoAOTCompiler.props index d3acbef92e6f5a..35010556bcf39b 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.props +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.props @@ -17,12 +17,14 @@ + From 450fe1ec003348026f493ab81877c6a01786bc78 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Mon, 17 May 2021 09:45:10 -0400 Subject: [PATCH 03/51] See if trimming helps w/ the build time --- eng/pipelines/runtime-staging.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml index 322242a2e39e68..f8e730471d9368 100644 --- a/eng/pipelines/runtime-staging.yml +++ b/eng/pipelines/runtime-staging.yml @@ -116,8 +116,8 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_AOT_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunDisabledAndroidTests=true /p:RunAOTCompilation=true - timeoutInMinutes: 580 + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true /p:EnableAggressiveTrimming=true + timeoutInMinutes: 180 condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true), From 4409b8960a90813a2557fe67542b3321cfb35f2c Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Mon, 17 May 2021 10:46:11 -0400 Subject: [PATCH 04/51] Raise the default number of trampolines --- src/tasks/AotCompilerTask/MonoAOTCompiler.props | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.props b/src/tasks/AotCompilerTask/MonoAOTCompiler.props index 97bd24c7bb4fad..88335450fba40b 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.props +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.props @@ -17,14 +17,12 @@ - From 3a097ec4d84ebc8b86cb141a1ce4f82778ee728e Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Mon, 17 May 2021 16:49:34 -0400 Subject: [PATCH 05/51] Mirroring wasm skips for aot and trimming --- src/libraries/tests.proj | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 5530af517ee69f..65940d2ff81b17 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -134,6 +134,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 639fcf0e10278437cbe307711b43ef3096b5cf5d Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 18 May 2021 11:25:34 -0400 Subject: [PATCH 06/51] Skip more suites that fail aot --- src/libraries/tests.proj | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 65940d2ff81b17..a41815b43b9fec 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -168,6 +168,18 @@ + + + + + + + + + + + + From 490f7c54915c9035a0aa53f8fdaee7849cfe072d Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 18 May 2021 21:47:56 -0400 Subject: [PATCH 07/51] More exclusions. --- src/libraries/tests.proj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index a41815b43b9fec..81e5b02fd9074b 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -177,9 +177,13 @@ + + + + From 31f4555e5e7d150d18ecf2ab839ec544dd908d40 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 18 May 2021 22:34:58 -0400 Subject: [PATCH 08/51] More exclusions --- src/libraries/tests.proj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 81e5b02fd9074b..b8d429dc6e51ef 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -184,6 +184,8 @@ + + From 8d9ad90fc4a477952a6fc4eddf098eaf8a676be6 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Wed, 19 May 2021 10:30:59 -0400 Subject: [PATCH 09/51] See if default trimming produces better results --- eng/pipelines/runtime-staging.yml | 2 +- eng/testing/tests.mobile.targets | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml index ee66654f6de619..88eb32c766fb3b 100644 --- a/eng/pipelines/runtime-staging.yml +++ b/eng/pipelines/runtime-staging.yml @@ -156,7 +156,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_AOT_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true /p:EnableAggressiveTrimming=true + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true timeoutInMinutes: 180 condition: >- or( diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 2fedf68d956005..ecc3ef6d55c42a 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -44,6 +44,10 @@ + true + + true + $(AdditionalXHarnessArguments) --arg=-m=$(XUnitMethodName) $(AdditionalXHarnessArguments) --arg=-c=$(XUnitClassName) From eb11e93beadc9ae264de856e6a36ff19ca7f8bf5 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Wed, 19 May 2021 13:12:58 -0400 Subject: [PATCH 10/51] Make sure to skip problematic tests --- eng/pipelines/runtime-staging.yml | 2 +- src/libraries/tests.proj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml index 88eb32c766fb3b..003b925fb619c6 100644 --- a/eng/pipelines/runtime-staging.yml +++ b/eng/pipelines/runtime-staging.yml @@ -156,7 +156,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_AOT_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true /p:EnableTrimming=true timeoutInMinutes: 180 condition: >- or( diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index b8d429dc6e51ef..1343aaa8672773 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -134,7 +134,7 @@ - + @@ -178,7 +178,7 @@ - + From cb132d12f85532d0a4065f61d040cb85f25f091a Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Wed, 19 May 2021 15:27:21 -0400 Subject: [PATCH 11/51] More skips --- src/libraries/tests.proj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 1343aaa8672773..50ca919e8de32c 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -179,6 +179,9 @@ + + + From 9f5991c7b3d8c2f376845a98c9d4ab0e4b08a853 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Wed, 19 May 2021 15:29:28 -0400 Subject: [PATCH 12/51] Trimming switch so the other builds don't fail --- eng/testing/tests.mobile.targets | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index ecc3ef6d55c42a..66d237424e8707 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -43,11 +43,13 @@ --expected-exit-code $(ExpectedExitCode) - + true true + + $(AdditionalXHarnessArguments) --arg=-m=$(XUnitMethodName) $(AdditionalXHarnessArguments) --arg=-c=$(XUnitClassName) From 9baa8747e5339583880fe990d763e602db715eb0 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Tue, 25 May 2021 17:09:38 +0300 Subject: [PATCH 13/51] Skip the tests failing due to 'Attempting to JIT compile method while running in aot-only mode.' --- .../Common/tests/TestUtilities/System/PlatformDetection.cs | 1 + .../tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs | 1 + .../System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs | 1 + src/tasks/AndroidAppBuilder/Templates/monodroid.c | 1 + src/tasks/AppleAppBuilder/Templates/runtime.m | 1 + 5 files changed, 5 insertions(+) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 34c4bb86c37ded..3c153237641139 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -29,6 +29,7 @@ public static partial class PlatformDetection public static bool IsNetBSD => RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")); public static bool IsAndroid => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID")); public static bool IsiOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")); + public static bool IsNotDeviceAOT => !((IsAndroid || IsiOS) && IsMonoAOT); public static bool IstvOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")); public static bool IsMacCatalyst => RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST")); public static bool Isillumos => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ILLUMOS")); diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs index 182fb0a3d717d8..25eb7035959abe 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs @@ -16,6 +16,7 @@ using System.Xml.Serialization; using Xunit; +[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static partial class XmlSerializerTests { [Fact] diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs index 364c4f880082b8..a6c6e58ddff125 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs @@ -16,6 +16,7 @@ using System.Xml.Serialization; using Xunit; +[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static partial class XmlSerializerTests { #if ReflectionOnly|| XMLSERIALIZERGENERATORTESTS diff --git a/src/tasks/AndroidAppBuilder/Templates/monodroid.c b/src/tasks/AndroidAppBuilder/Templates/monodroid.c index d2ed75763650d2..f1acb185583c43 100644 --- a/src/tasks/AndroidAppBuilder/Templates/monodroid.c +++ b/src/tasks/AndroidAppBuilder/Templates/monodroid.c @@ -262,6 +262,7 @@ mono_droid_runtime_init (const char* executable, int managed_argc, char* managed #elif FORCE_AOT register_aot_modules(); mono_jit_set_aot_mode(MONO_AOT_MODE_FULL); + setenv("MONO_AOT_MODE", "aot", true); #endif mono_jit_init_version ("dotnet.android", "mobile"); diff --git a/src/tasks/AppleAppBuilder/Templates/runtime.m b/src/tasks/AppleAppBuilder/Templates/runtime.m index 8b8d6d181d00de..f03367980717e8 100644 --- a/src/tasks/AppleAppBuilder/Templates/runtime.m +++ b/src/tasks/AppleAppBuilder/Templates/runtime.m @@ -268,6 +268,7 @@ // register modules register_aot_modules (); mono_jit_set_aot_mode (MONO_AOT_MODE_FULL); + setenv("MONO_AOT_MODE", "aot", TRUE); #endif mono_debug_init (MONO_DEBUG_FORMAT_MONO); From 5887106451cff08d684e68312ce7bd692aaaec2d Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Tue, 25 May 2021 17:43:51 +0300 Subject: [PATCH 14/51] Remove redundant attribute --- .../tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs index 25eb7035959abe..182fb0a3d717d8 100644 --- a/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs +++ b/src/libraries/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.RuntimeOnly.cs @@ -16,7 +16,6 @@ using System.Xml.Serialization; using Xunit; -[ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static partial class XmlSerializerTests { [Fact] From 6bfe553c66c6c387c5fbc81d2105aa695e8bf4b2 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Wed, 26 May 2021 11:55:15 +0300 Subject: [PATCH 15/51] Skip more library tests due to "Attempting to JIT compile method ... while running in aot-only mode." --- .../tests/Extensions/ConfigurationRootTest.cs | 2 +- .../tests/FileConfigurationProviderTest.cs | 1 + .../tests/CompilationLibraryTests.cs | 4 +- .../tests/CompositeResolverTests.cs | 1 + .../tests/DependencyContextBuilderTests.cs | 12 ++-- .../tests/DependencyContextJsonReaderTest.cs | 18 ++--- .../tests/DependencyContextJsonWriterTests.cs | 2 +- .../tests/DependencyContextLoaderTests.cs | 4 +- .../tests/DependencyContextTests.cs | 8 +-- .../tests/CompositeFileProviderTests.cs | 4 +- .../DefaultHttpClientFactoryTest.cs | 6 +- .../DefaultHttpMessageHandlerBuilderTest.cs | 4 +- ...tFactoryServiceCollectionExtensionsTest.cs | 68 +++++++++---------- .../tests/Common/LoggerFactoryTest.cs | 8 +-- .../tests/Common/TraceSourceLoggerTest.cs | 4 +- .../tests/CompositeChangeTokenTest.cs | 8 +-- 16 files changed, 78 insertions(+), 76 deletions(-) diff --git a/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs b/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs index d61144d0e43138..d66ae1cb13072a 100644 --- a/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs +++ b/src/libraries/Common/tests/Extensions/ConfigurationRootTest.cs @@ -37,7 +37,7 @@ public void RootDisposesProviders() Assert.True(provider5.IsDisposed); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void RootDisposesChangeTokenRegistrations() { var changeToken = new ChangeToken(); diff --git a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs index 1913f764d0c307..cddeaa1a8edf79 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/tests/FileConfigurationProviderTest.cs @@ -11,6 +11,7 @@ namespace Microsoft.Extensions.Configuration.FileExtensions.Test { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class FileConfigurationProviderTest { [Fact] diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs index a3f2d8acc9e924..9ff485eef72e3d 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.DependencyModel.Tests { public class CompilationLibraryTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ResolveReferencePathsAcceptsCustomResolvers() { var fail = new Mock(); @@ -48,7 +48,7 @@ public void ResolveReferencePathsAcceptsCustomResolvers() Times.Never()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ResolveReferencePathsAcceptsNullCustomResolvers() { var library = TestLibraryFactory.Create(); diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs index 99fb51405af9b7..5a8e78af9c62a8 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs @@ -12,6 +12,7 @@ namespace Microsoft.Extensions.DependencyModel.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class CompositeResolverTests { [Fact] diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextBuilderTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextBuilderTests.cs index b6f64911bcf5c9..d3b790ac03e357 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextBuilderTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextBuilderTests.cs @@ -122,7 +122,7 @@ public void TakesServicableFromPackageDescription() lib.Serviceable.Should().BeTrue(); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void FillsRuntimeLibraryProperties() { var context = Build(runtimeExports: new[] @@ -200,7 +200,7 @@ public void FillsRuntimeLibraryProperties() asm.HashPath.Should().BeNull(); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void FiltersDuplicatedDependencies() { var context = Build(runtimeExports: new[] @@ -229,7 +229,7 @@ public void FiltersDuplicatedDependencies() lib.Dependencies.Should().OnlyContain(l => l.Name == "System.Collections" && l.Version == "2.0.0"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void FillsCompileLibraryProperties() { var context = Build(compilationExports: new[] @@ -285,7 +285,7 @@ public void FillsCompileLibraryProperties() asm.HashPath.Should().BeNull(); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void FillsResources() { var context = Build(runtimeExports: new[] @@ -303,7 +303,7 @@ public void FillsResources() lib.ResourceAssemblies.Should().OnlyContain(l => l.Locale == "en-US" && l.Path == "resources/en-US/Pack.Age.dll"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReferenceAssembliesPathRelativeToDefaultRoot() { var context = Build(compilationExports: new[] @@ -320,7 +320,7 @@ public void ReferenceAssembliesPathRelativeToDefaultRoot() asm.Assemblies.Should().OnlyContain(a => a == Path.Combine("sub", "System.Collections.dll")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void SkipsBuildDependencies() { var context = Build(compilationExports: new[] diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs index fcdca9eb8d40eb..589937e663a675 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs @@ -229,7 +229,7 @@ public void IgnoresExtraTopLevelNodes() context.Target.Framework.Should().Be(".NETCoreApp,Version=v1.0"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadsRuntimeGraph() { var context = Read( @@ -253,7 +253,7 @@ public void ReadsRuntimeGraph() .Fallbacks.Should().BeEquivalentTo("linux-x64", "unix"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadsCompilationTarget() { var context = Read( @@ -324,7 +324,7 @@ public void RejectsMissingLibrary() Assert.Equal($"Cannot find library information for System.Banana/1.0.0", exception.Message); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void IgnoresUnknownPropertiesInLibrary() { var context = Read( @@ -362,7 +362,7 @@ public void IgnoresUnknownPropertiesInLibrary() package.HashPath.Should().BeNull(); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadsCompilationTargetWithNullPathAndHashPath() { var context = Read( @@ -401,7 +401,7 @@ public void ReadsCompilationTargetWithNullPathAndHashPath() package.HashPath.Should().BeNull(); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadsCompilationTargetWithMissingPathAndHashPath() { var context = Read( @@ -481,13 +481,13 @@ public void DoesNotReadRuntimeLibraryFromCompilationOnlyEntries() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadsRuntimeLibrariesWithSubtargetsFromMainTargetForPortable() { ReadsRuntimeLibrariesWithSubtargetsFromMainTargetForPortableCore(false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadsRuntimeLibrariesWithSubtargetsFromMainTargetForPortableWithAssemblyVersions() { ReadsRuntimeLibrariesWithSubtargetsFromMainTargetForPortableCore(true); @@ -592,7 +592,7 @@ private void ReadsRuntimeLibrariesWithSubtargetsFromMainTargetForPortableCore(bo package.NativeLibraryGroups.GetRuntimeAssets("win7-x64").Should().Contain("lib/win7/Banana.dll"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadsRuntimeTargetPlaceholdersAsEmptyGroups() { var context = Read( @@ -628,7 +628,7 @@ public void ReadsRuntimeTargetPlaceholdersAsEmptyGroups() .Which.AssetPaths.Should().BeEmpty(); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void IgnoresUnknownPropertiesInRuntimeTargets() { var context = Read( diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs index 50f6bbdd54642b..c0fe7035dc0097 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs @@ -54,7 +54,7 @@ public DependencyContext Create( ); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void SavesRuntimeGraph() { var result = Save(Create( diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs index e7e5ce6ecb8167..5e3b658dc842be 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs @@ -10,7 +10,7 @@ namespace Microsoft.Extensions.DependencyModel.Tests { public class DependencyContextLoaderTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "GetEntryAssembly() returns null")] public void LoadLoadsExtraPaths() { @@ -76,7 +76,7 @@ public void LoadLoadsExtraPaths() context.RuntimeLibraries.Should().Contain(l => l.Name == "System.Banana"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadCanLoadANonEntryAssembly() { var loader = new DependencyContextLoader(); diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs index 0c570d6a441f25..a5c06a7e062333 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs @@ -10,7 +10,7 @@ namespace Microsoft.Extensions.DependencyModel.Tests { public class DependencyContextTests { - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData("System.Collections.dll", "System.Collections")] [InlineData("System.Collections.ni.dll", "System.Collections")] [InlineData("mscorlib", "mscorlib")] @@ -37,7 +37,7 @@ public void GetRuntimeAssemblyNamesExtractsCorrectAssemblyName(string path, stri assets.Should().OnlyContain(a => a.Name == expected); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetRuntimeAssemblyNamesReturnsRIDLessAssetsIfNoRIDSpecificAssetsInLibrary() { var context = BuildTestContext(); @@ -46,7 +46,7 @@ public void GetRuntimeAssemblyNamesReturnsRIDLessAssetsIfNoRIDSpecificAssetsInLi assets.Should().OnlyContain(a => a.Name == "System.Collections"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetRuntimeAssemblyNamesReturnsMostSpecificAssetIfRIDSpecificAssetInLibrary() { var context = BuildTestContext(); @@ -64,7 +64,7 @@ public void GetRuntimeAssemblyNamesReturnsEmptyIfEmptyRuntimeGroupPresent() assets.Should().BeEmpty(); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetRuntimeNativeAssetsReturnsEmptyIfNoGroupsMatch() { var context = BuildTestContext(); diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs b/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs index da09149c1adbbc..d6d5f2425ebdaf 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs @@ -93,7 +93,7 @@ public void GetDirectoryContents_ReturnsNonExistingEmptySequence_IfResourcesDoNo Assert.Empty(files); } - [Fact] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDirectoryContents_ReturnsCombinaisionOFFiles() { // Arrange @@ -121,7 +121,7 @@ public void GetDirectoryContents_ReturnsCombinaisionOFFiles() file => Assert.Same(file3, file)); } - [Fact] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDirectoryContents_ReturnsCombinaitionOFFiles_WhenSomeFileProviderRetunsNoContent() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs index 72d89b17f8ab56..3ffff35afc91c2 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpClientFactoryTest.cs @@ -82,7 +82,7 @@ public void Factory_MultipleCalls_CachesHandler() Assert.NotSame(client1, client2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Factory_DisposeClient_DoesNotDisposeHandler() { // Arrange @@ -107,7 +107,7 @@ public void Factory_DisposeClient_DoesNotDisposeHandler() // Assert (does not throw) } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Factory_DisposeHandler_DoesNotDisposeInnerHandler() { // Arrange @@ -170,7 +170,7 @@ public void Factory_CreateClient_WithName_UsesNamedOptions() Assert.Equal(1, count); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Factory_CreateClient_FiltersCanDecorateBuilder() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs index 426bf7195ebd4f..df866433c45c8a 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DefaultHttpMessageHandlerBuilderTest.cs @@ -32,7 +32,7 @@ public void Ctor_SetsPrimaryHandler() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Build_NoAdditionalHandlers_ReturnsPrimaryHandler() { // Arrange @@ -48,7 +48,7 @@ public void Build_NoAdditionalHandlers_ReturnsPrimaryHandler() Assert.Same(builder.PrimaryHandler, handler); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Build_SomeAdditionalHandlers_PutsTogetherDelegatingHandlers() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs index 9aa83a8f34dd03..7db07192481e65 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs @@ -143,7 +143,7 @@ public void AddHttpClient_WithName_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_ConfiguresNamedClient() { // Arrange @@ -166,7 +166,7 @@ public void AddHttpClient_WithTypedClient_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithGenericTypedClient_ConfiguresNamedClient() { // Arrange @@ -189,7 +189,7 @@ public void AddHttpClient_WithGenericTypedClient_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClientAndImplementation_ConfiguresNamedClient() { // Arrange @@ -212,7 +212,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_ConfiguresNamedClient Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_AndName_ConfiguresNamedClient() { // Arrange @@ -235,7 +235,7 @@ public void AddHttpClient_WithTypedClient_AndName_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClientAndImplementation_AndName_ConfiguresNamedClient() { // Arrange @@ -258,7 +258,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndName_ConfiguresNam Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_AndDelegate_ConfiguresNamedClient() { // Arrange @@ -285,7 +285,7 @@ public void AddHttpClient_WithTypedClient_AndDelegate_ConfiguresNamedClient() Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClientAndImplementation_AndDelegate_ConfiguresNamedClient() { // Arrange @@ -312,7 +312,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndDelegate_Configure Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddTypedClient_ConfiguresNamedClient() { // Arrange @@ -335,7 +335,7 @@ public void AddHttpClient_AddTypedClient_ConfiguresNamedClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddTypedClientAndImplementation_ConfiguresNamedClient() { // Arrange @@ -499,7 +499,7 @@ public void AddHttpClient_WithTypedClient_WithFactoryServicesAndName_ConfiguresN Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameTypedClientTwice_WithSameName_Works() { // Arrange @@ -521,7 +521,7 @@ public void AddHttpClient_AddSameTypedClientTwice_WithSameName_Works() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameTypedClientTwice_WithSameName_WithAddTypedClient_Works() { // Arrange @@ -544,7 +544,7 @@ public void AddHttpClient_AddSameTypedClientTwice_WithSameName_WithAddTypedClien Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameTypedClientTwice_WithDifferentNames_IsAllowed() { // Arrange @@ -561,7 +561,7 @@ public void AddHttpClient_AddSameTypedClientTwice_WithDifferentNames_IsAllowed() Assert.Equal(2, clients.Count()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameTypedClientTwice_WithDifferentNames_WithAddTypedClient_IsAllowed() { // Arrange @@ -596,7 +596,7 @@ public void AddHttpClient_AddSameNameWithTypedClientTwice_ThrowsError() ex.Message); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameNameWithTypedClientTwice_WithAddTypedClient_IsAllowed() { // Arrange @@ -624,7 +624,7 @@ public void AddHttpClient_AddSameNameWithTypedClientTwice_WithAddTypedClient_IsA Assert.Equal("http://example.com/", client2.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_AddSameNameWithTypedClientTwice_WithExplicitName_IsAllowed() { // Arrange @@ -652,7 +652,7 @@ public void AddHttpClient_AddSameNameWithTypedClientTwice_WithExplicitName_IsAll Assert.Equal("http://example.com/", client2.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_RegisteringMultipleTypes_WithAddTypedClient_IsAllowed() { // Arrange @@ -709,7 +709,7 @@ public void AddHttpClient_AddTypedClient_WithServiceDelegate_ConfiguresNamedClie Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_AndName_AndDelegate_ConfiguresNamedClient() { // Arrange @@ -736,7 +736,7 @@ public void AddHttpClient_WithTypedClient_AndName_AndDelegate_ConfiguresNamedCli Assert.Equal("http://example2.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpMessageHandler_WithName_NewHandlerIsSurroundedByLogging_ForHttpClient() { // Arrange @@ -770,7 +770,7 @@ public void AddHttpMessageHandler_WithName_NewHandlerIsSurroundedByLogging_ForHt h => Assert.IsType(h)); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresClient() { // Arrange @@ -797,7 +797,7 @@ public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresClient() Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_ConfiguresClient() { // Arrange @@ -824,7 +824,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_Co Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresNamedClient() { // Arrange @@ -851,7 +851,7 @@ public void AddHttpClient_WithTypedClient_AndServiceDelegate_ConfiguresNamedClie Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_ConfiguresNamedClient() { // Arrange @@ -878,7 +878,7 @@ public void AddHttpClient_WithTypedClientAndImplementation_AndServiceDelegate_Co Assert.Equal("http://example.com/", client.HttpClient.BaseAddress.AbsoluteUri); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpMessageHandler_WithName_NewHandlerIsSurroundedByLogging_ForHttpMessageHandler() { var serviceCollection = new ServiceCollection(); @@ -929,7 +929,7 @@ public void AddHttpClient_ProvidesSameImplementationForClientsAndHandlers() Assert.Same(clientFactory, handlerFactory); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AddHttpClient_MessageHandler_SingletonDependency() { // Arrange @@ -971,7 +971,7 @@ public async Task AddHttpClient_MessageHandler_SingletonDependency() #endif } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AddHttpClient_MessageHandler_Scope_SingletonDependency() { // Arrange @@ -1025,7 +1025,7 @@ public async Task AddHttpClient_MessageHandler_Scope_SingletonDependency() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_MessageHandler_ScopedDependency() { // Arrange @@ -1045,7 +1045,7 @@ public void AddHttpClient_MessageHandler_ScopedDependency() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AddHttpClient_MessageHandler_Scope_ScopedDependency() { // Arrange @@ -1098,7 +1098,7 @@ public async Task AddHttpClient_MessageHandler_Scope_ScopedDependency() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AddHttpClient_MessageHandler_TransientDependency() { // Arrange @@ -1140,7 +1140,7 @@ public async Task AddHttpClient_MessageHandler_TransientDependency() #endif } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AddHttpClient_MessageHandler_Scope_TransientDependency() { // Arrange @@ -1185,7 +1185,7 @@ public async Task AddHttpClient_MessageHandler_Scope_TransientDependency() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationContext_ShouldNotHangs() { // Arrange @@ -1229,7 +1229,7 @@ public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationCon } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void SuppressScope_False_CreatesNewScope() { // Arrange @@ -1257,7 +1257,7 @@ public void SuppressScope_False_CreatesNewScope() Assert.NotSame(services, capturedServices); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void SuppressScope_False_InScope_CreatesNewScope() { // Arrange @@ -1289,7 +1289,7 @@ public void SuppressScope_False_InScope_CreatesNewScope() } } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void SuppressScope_True_DoesNotCreateScope() { // Arrange @@ -1317,7 +1317,7 @@ public void SuppressScope_True_DoesNotCreateScope() Assert.NotSame(services, capturedServices); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsNotDeviceAOT))] public void SuppressScope_True_InScope_DoesNotCreateScope() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs index e31d7e8c26c135..cfde5b3adc9cee 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryTest.cs @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.Logging.Test { public class LoggerFactoryTest { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void AddProvider_ThrowsAfterDisposed() { var factory = new LoggerFactory(); @@ -52,7 +52,7 @@ public void Dispose_MultipleCallsNoop() factory.Dispose(); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Dispose_ProvidersAreDisposed() { // Arrange @@ -82,7 +82,7 @@ private static ILoggerProvider CreateProvider() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Dispose_ThrowException_SwallowsException() { // Arrange @@ -493,7 +493,7 @@ public void BeginScope_ReturnsCompositeToken_ForMultipleLoggers() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateDisposeDisposesInnerServiceProvider() { var disposed = false; diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs index 52632e471466cc..08bea33562f180 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs @@ -58,10 +58,10 @@ public static void MultipleLoggers_IsEnabledReturnsCorrectValue(SourceLevels fir Assert.Equal(expected, logger.IsEnabled(LogLevel.Information)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true)] [InlineData(false)] - public static void Log_Shoud_Add_Exception_To_Message_Whether_Formatter_Is_Null_Or_Not(bool shouldFormatterBeNull) + public static void Log_Should_Add_Exception_To_Message_Whether_Formatter_Is_Null_Or_Not(bool shouldFormatterBeNull) { // Arrange Mock traceListener = new Mock(); diff --git a/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs b/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs index 549cfcc6138e35..40b06b17a53553 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/tests/CompositeChangeTokenTest.cs @@ -42,7 +42,7 @@ public void RegisteredCallbacks_AreInvokedExactlyOnce() Assert.Equal(1, count2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void HasChanged_IsTrue_IfAnyTokenHasChanged() { // Arrange @@ -59,7 +59,7 @@ public void HasChanged_IsTrue_IfAnyTokenHasChanged() Assert.True(compositeChangeToken.HasChanged); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void HasChanged_IsFalse_IfNoTokenHasChanged() { // Arrange @@ -73,7 +73,7 @@ public void HasChanged_IsFalse_IfNoTokenHasChanged() Assert.False(compositeChangeToken.HasChanged); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ActiveChangeCallbacks_IsTrue_IfAnyTokenHasActiveChangeCallbacks() { // Arrange @@ -89,7 +89,7 @@ public void ActiveChangeCallbacks_IsTrue_IfAnyTokenHasActiveChangeCallbacks() Assert.True(compositeChangeToken.ActiveChangeCallbacks); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ActiveChangeCallbacks_IsFalse_IfNoTokenHasActiveChangeCallbacks() { // Arrange From 3669c170d71cbc1e7452288854baca7fa8da395f Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Wed, 26 May 2021 12:56:00 +0300 Subject: [PATCH 16/51] Fix wrong attribute --- .../tests/CompositeFileProviderTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs b/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs index d6d5f2425ebdaf..0e20c846f9e89f 100644 --- a/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs +++ b/src/libraries/Microsoft.Extensions.FileProviders.Composite/tests/CompositeFileProviderTests.cs @@ -93,7 +93,7 @@ public void GetDirectoryContents_ReturnsNonExistingEmptySequence_IfResourcesDoNo Assert.Empty(files); } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDirectoryContents_ReturnsCombinaisionOFFiles() { // Arrange @@ -121,7 +121,7 @@ public void GetDirectoryContents_ReturnsCombinaisionOFFiles() file => Assert.Same(file3, file)); } - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDirectoryContents_ReturnsCombinaitionOFFiles_WhenSomeFileProviderRetunsNoContent() { // Arrange From 27e6fe0d62146c1b9ef6ff51f5de81f2f840d9da Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Wed, 26 May 2021 14:29:49 +0300 Subject: [PATCH 17/51] Add System using --- .../tests/DependencyContextJsonWriterTests.cs | 1 + .../tests/DependencyContextLoaderTests.cs | 1 + .../tests/DependencyContextTests.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs index c0fe7035dc0097..41fe4c0f10d280 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Collections.Generic; using System.IO; using System.Text; diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs index 5e3b658dc842be..94078f5d66c3bf 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using FluentAssertions; +using System; using System.IO; using System.Reflection; using Xunit; diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs index a5c06a7e062333..2f114799acce4a 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using FluentAssertions; +using System; using System.IO; using System.Linq; using Xunit; From e680218d2a8b6472301eab4d6d578e1d7cd6e4d2 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 27 May 2021 18:01:21 +0300 Subject: [PATCH 18/51] Skip more library tests due to "Attempting to JIT compile method ... while running in aot-only mode." --- .../tests/DependencyContextTests.cs | 2 +- .../Registration/ExportBuilderUnitTests.cs | 1 + .../Registration/PartBuilderInterfaceTests.cs | 2 +- .../Registration/PartBuilderUnitTests.cs | 1 + .../RegistrationContextUnitTests.cs | 1 + .../tests/PartBuilderInterfaceTests.cs | 4 +-- .../tests/PartBuilderOfTTests.cs | 10 +++---- .../tests/PartBuilderTests.cs | 14 +++++----- .../tests/ContainerConfigurationTests.cs | 28 +++++++++---------- .../tests/ReflectionTests.cs | 1 + .../tests/StackTraceSymbolsTests.cs | 2 +- .../tests/DataContractSerializerTests.cs | 1 + .../tests/DriveInfo.Unix.Tests.cs | 2 +- .../HttpClientJsonExtensionsTests.cs | 8 +++--- .../HttpContentJsonExtensionsTests.cs | 17 +++++------ .../tests/FunctionalTests/JsonContentTests.cs | 10 +++---- .../JsonContentTests.netcoreapp.cs | 4 +-- .../UnitTests/TranscodingReadStreamTests.cs | 8 +++--- .../UnitTests/TranscodingWriteStreamTests.cs | 1 + .../tests/ILGenerator/Emit1Tests.cs | 10 +++---- .../tests/ILGenerator/Emit3Tests.cs | 8 +++--- .../tests/ILGenerator/Emit4Tests.cs | 8 +++--- .../tests/ILGenerator/EmitMethodInfo.cs | 2 ++ .../tests/ILGenerator/EmitWriteLineTests.cs | 1 + .../tests/ILGenerator/ExceptionEmitTests.cs | 2 +- 25 files changed, 79 insertions(+), 69 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs index 2f114799acce4a..11273461f454c7 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs @@ -247,7 +247,7 @@ public void MergeMergesLibrariesWithDifferentCasing() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void MergeMergesRuntimeGraph() { var context = new DependencyContext( diff --git a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/ExportBuilderUnitTests.cs b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/ExportBuilderUnitTests.cs index 2fa7eb493cc6a0..e29b2acac80d97 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/ExportBuilderUnitTests.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/ExportBuilderUnitTests.cs @@ -8,6 +8,7 @@ namespace System.ComponentModel.Composition.Registration.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class ExportBuilderUnitTests { public interface IFoo {} diff --git a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderInterfaceTests.cs b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderInterfaceTests.cs index 252a5c1f8b53b8..8a861ce1ecd479 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderInterfaceTests.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderInterfaceTests.cs @@ -46,7 +46,7 @@ public class Importer [Import(AllowDefault=true)] public BareClass BareClass; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StandardExportInterfacesShouldWork() { var builder = new RegistrationBuilder(); diff --git a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderUnitTests.cs b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderUnitTests.cs index f63ac12f11dd1a..84f02047ffc794 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderUnitTests.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/PartBuilderUnitTests.cs @@ -122,6 +122,7 @@ public ManyConstructorsController( } } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class PartBuilderUnitTests { [Fact] diff --git a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationContextUnitTests.cs b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationContextUnitTests.cs index 25a18f1bcbd46d..72000dece321eb 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationContextUnitTests.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/tests/System/ComponentModel/Composition/Registration/RegistrationContextUnitTests.cs @@ -11,6 +11,7 @@ public interface IFoo { } public class FooImplementation1 : IFoo { } public class FooImplementation2 : IFoo { } + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class RegistrationBuilderUnitTests { [Fact] diff --git a/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs b/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs index e0b058085c32cb..3aca86b1aefe80 100644 --- a/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs +++ b/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs @@ -97,7 +97,7 @@ public void StandardExportInterfacesShouldWork() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StandardExportInterfacesInterfaceFilterDefaultContractShouldWork() { //Same test as above only using default export builder @@ -134,7 +134,7 @@ public void StandardExportInterfacesInterfaceFilterDefaultContractShouldWork() Assert.NotNull(importer.BareClass); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StandardExportInterfacesInterfaceFilterConfiguredContractShouldWork() { //Same test as above only using default export builder diff --git a/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs b/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs index f981b7639f393d..2be596c49267f2 100644 --- a/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs +++ b/src/libraries/System.Composition.Convention/tests/PartBuilderOfTTests.cs @@ -468,7 +468,7 @@ private static ConstructorInfo GetSelectedConstructor(ConventionBuilder builder, return reply; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfied_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -484,7 +484,7 @@ public void NotifyImportsSatisfied_ShouldSucceed() Assert.Equal(1, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -500,7 +500,7 @@ public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() Assert.Equal(1, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -516,7 +516,7 @@ public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() Assert.Equal(1, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedAttributeAppliedToDerivedClassExportBase_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -533,7 +533,7 @@ public void NotifyImportsSatisfiedAttributeAppliedToDerivedClassExportBase_Shoul Assert.Equal(0, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedTwice_ShouldSucceed() { var builder = new ConventionBuilder(); diff --git a/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs b/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs index 966218048d1127..f1ced4774569ab 100644 --- a/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs +++ b/src/libraries/System.Composition.Convention/tests/PartBuilderTests.cs @@ -468,7 +468,7 @@ public void ExportSelectorNull_ShouldThrowArgumentNull() AssertExtensions.Throws("propertyFilter", () => builder.ForTypesMatching((t) => true).ExportProperties(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void InsideTheLambdaCallGetCustomAttributesShouldSucceed() { var builder = new ConventionBuilder(); @@ -486,7 +486,7 @@ public void InsideTheLambdaCallGetCustomAttributesShouldSucceed() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -503,7 +503,7 @@ public void NotifyImportsSatisfiedAttributeAlreadyApplied_ShouldSucceed() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -520,7 +520,7 @@ public void NotifyImportsSatisfiedAttributeAppliedToBaseClass_ShouldSucceed() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedMultipleNotifications_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -536,7 +536,7 @@ public void NotifyImportsSatisfiedMultipleNotifications_ShouldSucceed() Assert.Equal(2, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedTwice_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -553,7 +553,7 @@ public void NotifyImportsSatisfiedTwice_ShouldSucceed() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedInvalidMethod_ShouldSucceed() { var builder = new ConventionBuilder(); @@ -569,7 +569,7 @@ public void NotifyImportsSatisfiedInvalidMethod_ShouldSucceed() Assert.Equal(0, test.OnImportsSatisfiedInvoked); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void NotifyImportsSatisfiedPropertiesAndFields_ShouldSucceed() { var builder = new ConventionBuilder(); diff --git a/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs b/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs index a30aa0a5045be0..32fbf932b03713 100644 --- a/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs +++ b/src/libraries/System.Composition.TypedParts/tests/ContainerConfigurationTests.cs @@ -61,7 +61,7 @@ public void WithProvider_NullProvider_ThrowsArgumentNullException() AssertExtensions.Throws("exportDescriptorProvider", () => configuration.WithProvider(null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithDefaultConventions_PartWithNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -75,7 +75,7 @@ public void WithDefaultConventions_PartWithNoMatchingConvention_Success() Assert.Equal("A", container.GetExport()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithDefaultConventions_IEnumerablePartsWithNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -89,7 +89,7 @@ public void WithDefaultConventions_IEnumerablePartsWithNoMatchingConvention_Succ Assert.Equal("A", container.GetExport()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithDefaultConventions_PartsArrayWithNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -103,7 +103,7 @@ public void WithDefaultConventions_PartsArrayWithNoMatchingConvention_Success() Assert.Equal("A", container.GetExport()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithDefaultConventions_PartTNoMatchingConvention_Success() { var conventions = new ConventionBuilder(); @@ -138,7 +138,7 @@ public void WithDefaultConventions_AlreadyHasDefaultConventions_ThrowsInvalidOpe Assert.Throws(() => configuration.WithDefaultConventions(new ConventionBuilder())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithPartT_Convention_Success() { var conventions = new ConventionBuilder(); @@ -151,7 +151,7 @@ public void WithPartT_Convention_Success() Assert.Equal("A", container.GetExport()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithPart_Convention_Success() { var conventions = new ConventionBuilder(); @@ -172,7 +172,7 @@ public void WithPart_NullPartType_ThrowsArgumentNullException() AssertExtensions.Throws("partType", () => configuration.WithPart(null, new ConventionBuilder())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WithParts_Convention_Success() { var conventions = new ConventionBuilder(); @@ -254,7 +254,7 @@ public void WithAssemby_Null_ThrowsNullReferenceExceptionOnCreation() Assert.Throws(() => configuration.CreateContainer()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_ExportedSubClass_Success() { CompositionHost container = new ContainerConfiguration() @@ -274,7 +274,7 @@ public class Base public object Prop { get; set; } = "Derived"; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_OpenGenericTypes_Success() { var conventions = new ConventionBuilder(); @@ -303,7 +303,7 @@ public EFRepository(IContainer test) { } public T Fetch() => default(T); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_ImportConventionsWithInheritedProperties_Success() { var conventions = new ConventionBuilder(); @@ -330,7 +330,7 @@ public class BaseWithImport public class DerivedFromBaseWithImport : BaseWithImport { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_ExportConventionsWithInheritedProperties_Success() { var conventions = new ConventionBuilder(); @@ -351,7 +351,7 @@ public class BaseWithExport public class DerivedFromBaseWithExport : BaseWithExport { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_ExportsToInheritedProperties_DontInterfereWithBase() { var conventions = new ConventionBuilder(); @@ -419,7 +419,7 @@ public class BaseWithCustomExport { } public class DerivedFromBaseWithCustomExport : BaseWithCustomExport { } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContainer_OpenGenericTypePart_Success() { ContainerConfiguration configuration = new ContainerConfiguration().WithParts(typeof(GenericExportedType<>)); @@ -593,7 +593,7 @@ public void DebuggerAttributes_GetViaReflection_Success(ContainerConfiguration c } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateContiner_GenericExportWithDependencyConstructorHasConvention_Success() { var conventions = new ConventionBuilder(); diff --git a/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs b/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs index 291a1e5bbf13a4..8ce2092f04b240 100644 --- a/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs +++ b/src/libraries/System.Composition.TypedParts/tests/ReflectionTests.cs @@ -11,6 +11,7 @@ namespace System.Composition.TypedParts.Tests /// /// Tests dealing with reflection usage in System.Composition /// + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class ReflectionTests { public static bool HasMultiplerProcessors { get; } = Environment.ProcessorCount > 1; diff --git a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs index a095dc87007c08..7605c60f17180f 100644 --- a/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs +++ b/src/libraries/System.Diagnostics.StackTrace/tests/StackTraceSymbolsTests.cs @@ -10,7 +10,7 @@ namespace System.Diagnostics.SymbolStore.Tests public class StackTraceSymbolsTests { [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/51399", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/51399", TestPlatforms.Android | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public void StackTraceSymbolsDoNotLockFile() { var asmPath = AssemblyPathHelper.GetAssemblyLocation(typeof(StackTraceSymbolsTests).Assembly); diff --git a/src/libraries/System.Drawing.Primitives/tests/DataContractSerializerTests.cs b/src/libraries/System.Drawing.Primitives/tests/DataContractSerializerTests.cs index 037e05a3f33e1f..c2a4af2613de2a 100644 --- a/src/libraries/System.Drawing.Primitives/tests/DataContractSerializerTests.cs +++ b/src/libraries/System.Drawing.Primitives/tests/DataContractSerializerTests.cs @@ -12,6 +12,7 @@ namespace System.Drawing.Primitives.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class DataContractSerializerTests { [Fact] diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs index 9244ddff9e68e9..eb9800ec0147e1 100644 --- a/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs +++ b/src/libraries/System.IO.FileSystem.DriveInfo/tests/DriveInfo.Unix.Tests.cs @@ -22,7 +22,7 @@ public void TestConstructor() Assert.Equal("/", new DriveInfo("/").Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [PlatformSpecific(TestPlatforms.AnyUnix)] public void TestGetDrives() { diff --git a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs index 580806a40aac31..6a9f99826232b2 100644 --- a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpClientJsonExtensionsTests.cs @@ -13,7 +13,7 @@ namespace System.Net.Http.Json.Functional.Tests { public class HttpClientJsonExtensionsTests { - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadFromJsonTestData))] public async Task TestGetFromJsonAsync(string json, bool containsQuotedNumbers) { @@ -80,7 +80,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(statusCode: HttpStatusCode.InternalServerError)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestPostAsJsonAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -123,7 +123,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestPutAsJsonAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -231,7 +231,7 @@ private void ValidateRequest(HttpRequestData requestData) Assert.Equal("application/json; charset=utf-8", contentType.Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task AllowNullRequesturlAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( diff --git a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpContentJsonExtensionsTests.cs b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpContentJsonExtensionsTests.cs index ebc3dc4dcc071b..d58ab3beb879d3 100644 --- a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpContentJsonExtensionsTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/HttpContentJsonExtensionsTests.cs @@ -22,7 +22,7 @@ public void ThrowOnNull() AssertExtensions.Throws("content", () => content.ReadFromJsonAsync(typeof(Person))); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadFromJsonTestData))] public async Task HttpContentGetThenReadFromJsonAsync(string json) { @@ -53,7 +53,7 @@ public static IEnumerable ReadFromJsonTestData() yield return new object[] { per.SerializeWithNumbersAsStrings() }; } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task HttpContentReturnValueIsNull() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -75,7 +75,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(headers: _headers, content: "null")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestReadFromJsonNoMessageBodyAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -94,7 +94,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(headers: _headers)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestGetFromJsonQuotedCharSetAsync() { List customHeaders = new List @@ -117,7 +117,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(headers: customHeaders, content: Person.Create().Serialize())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestGetFromJsonThrowOnInvalidCharSetAsync() { List customHeaders = new List @@ -140,7 +140,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(headers: customHeaders, content: Person.Create().Serialize())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestGetFromJsonAsyncTextPlainUtf16Async() { string json = Person.Create().Serialize(); @@ -168,7 +168,8 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( await server.HandleRequestAsync(statusCode: HttpStatusCode.OK, headers: headers, bytes: Encoding.Unicode.GetBytes(json)); }); } - [Fact] + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task EnsureDefaultJsonSerializerOptionsAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -184,7 +185,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync(headers: _headers, content: "{}")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData("application/json")] [InlineData("Application/Json")] [InlineData("application/foo+json")] // Structured Syntax Json Suffix diff --git a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs index 3fac43d3511c1a..6fbf27f420f7bf 100644 --- a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.cs @@ -69,7 +69,7 @@ public void TestJsonContentMediaType() Assert.Same(mediaType, content.Headers.ContentType); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task SendQuotedCharsetAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -103,7 +103,7 @@ public void TestJsonContentContentTypeIsNotTheSameOnMultipleInstances() Assert.NotSame(jsonContent1.Headers.ContentType, jsonContent2.Headers.ContentType); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task JsonContentMediaTypeValidateOnServerAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -161,7 +161,7 @@ public void JsonContentThrowsOnIncompatibleTypeAsync() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task ValidateUtf16IsTranscodedAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -184,7 +184,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task EnsureDefaultJsonSerializerOptionsAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( @@ -202,7 +202,7 @@ await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( server => server.HandleRequestAsync()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task TestJsonContentNullContentTypeAsync() { await HttpMessageHandlerLoopbackServer.CreateClientAndServerAsync( diff --git a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs index 698a4187a87c59..8e71bd742550e5 100644 --- a/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs +++ b/src/libraries/System.Net.Http.Json/tests/FunctionalTests/JsonContentTests.netcoreapp.cs @@ -16,13 +16,13 @@ public class JsonContentTests_Sync : JsonContentTestsBase { protected override Task SendAsync(HttpClient client, HttpRequestMessage request) => Task.Run(() => client.Send(request)); - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void JsonContent_CopyTo_Succeeds() { Person person = Person.Create(); using JsonContent content = JsonContent.Create(person); using MemoryStream stream = new MemoryStream(); - // HttpContent.CopyTo internally calls overriden JsonContent.SerializeToStream, which is the targeted method of this test. + // HttpContent.CopyTo internally calls overridden JsonContent.SerializeToStream, which is the targeted method of this test. content.CopyTo(stream, context: null, cancellationToken: default); stream.Seek(0, SeekOrigin.Begin); using StreamReader reader = new StreamReader(stream); diff --git a/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingReadStreamTests.cs b/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingReadStreamTests.cs index 67fa25cd519789..7378ef46ce14ef 100644 --- a/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingReadStreamTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingReadStreamTests.cs @@ -213,7 +213,7 @@ internal static TheoryData GetUnicodeText(int maxCharBufferSize) }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadAsyncInputLatin), "utf-32")] [MemberData(nameof(ReadAsyncInputUnicode), "utf-32")] public Task ReadAsync_Works_WhenInputIs_UTF32(string message) @@ -222,7 +222,7 @@ public Task ReadAsync_Works_WhenInputIs_UTF32(string message) return ReadAsyncTest(sourceEncoding, message); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadAsyncInputLatin), "utf-16")] [MemberData(nameof(ReadAsyncInputUnicode), "utf-16")] public Task ReadAsync_Works_WhenInputIs_Unicode(string message) @@ -231,7 +231,7 @@ public Task ReadAsync_Works_WhenInputIs_Unicode(string message) return ReadAsyncTest(sourceEncoding, message); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadAsyncInputLatin), "iso-8859-1")] public Task ReadAsync_Works_WhenInputIs_WesternEuropeanEncoding(string message) { @@ -240,7 +240,7 @@ public Task ReadAsync_Works_WhenInputIs_WesternEuropeanEncoding(string message) return ReadAsyncTest(sourceEncoding, message); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadAsyncInputLatin), "us-ascii")] public Task ReadAsync_Works_WhenInputIs_ASCII(string message) { diff --git a/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingWriteStreamTests.cs b/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingWriteStreamTests.cs index f9e7126fe49b18..851a266a19ee5f 100644 --- a/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingWriteStreamTests.cs +++ b/src/libraries/System.Net.Http.Json/tests/UnitTests/TranscodingWriteStreamTests.cs @@ -15,6 +15,7 @@ namespace System.Net.Http.Json.Functional.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class TranscodingWriteStreamTest { public static TheoryData WriteAsyncInputLatin => diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit1Tests.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit1Tests.cs index c7bfc39baeb58e..c0479c6162b48f 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit1Tests.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit1Tests.cs @@ -7,7 +7,7 @@ namespace System.Reflection.Emit.Tests { public class ILGeneratorEmit1 { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest1() { ModuleBuilder module = Helpers.DynamicModule(); @@ -42,7 +42,7 @@ public void PosTest1() Assert.Equal(expectedRet, createdMethod2.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest2() { ModuleBuilder module = Helpers.DynamicModule(); @@ -76,7 +76,7 @@ public void PosTest2() Assert.Equal(expectedRet, createdMethod2.Invoke(Activator.CreateInstance(createdType2), null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest3() { ModuleBuilder modbuild = Helpers.DynamicModule(); @@ -114,7 +114,7 @@ public void PosTest3() Assert.Equal(expectedRet, createdMethod2.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest4() { ModuleBuilder module = Helpers.DynamicModule(); @@ -152,7 +152,7 @@ public void PosTest4() Assert.Equal(expectedRet, createdMethod2.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest5() { ModuleBuilder module = Helpers.DynamicModule(); diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit3Tests.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit3Tests.cs index 2a1d4e9501930e..7a53af41b3d652 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit3Tests.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit3Tests.cs @@ -9,7 +9,7 @@ public struct EmitStruct3 { } public class ILGeneratorEmit3 { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest1() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); @@ -87,7 +87,7 @@ public void PosTest1() Assert.True((bool)createdMethod.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest2() { TypeBuilder tb = Helpers.DynamicType(TypeAttributes.Public); @@ -111,7 +111,7 @@ public void PosTest2() Assert.True((bool)createdMethod.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest3() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); @@ -132,7 +132,7 @@ public void PosTest3() Assert.True((bool)createdMethod.Invoke(null, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void PosTest4() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public); diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit4Tests.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit4Tests.cs index 96aae7540ae3ea..fea9c57ec4f5ef 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit4Tests.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/Emit4Tests.cs @@ -10,7 +10,7 @@ namespace System.Reflection.Emit.Tests [ActiveIssue("https://github.com/dotnet/runtime/issues/2383", TestPlatforms.Browser)] public class ILGeneratorEmit4 { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void TestEmitCalliBlittable() { int a = 1, b = 1, result = 2; @@ -45,7 +45,7 @@ public void TestEmitCalliBlittable() Assert.Equal(result, resultValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void TestEmitCalliManagedBlittable() { int a = 1, b = 1, result = 2; @@ -78,7 +78,7 @@ public void TestEmitCalliManagedBlittable() Assert.Equal(result, resultValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void TestDynamicMethodEmitCalliBlittable() { int a = 1, b = 1, result = 2; @@ -141,7 +141,7 @@ public void TestEmitCalliNonBlittable() Assert.Equal(result, resultValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void TestDynamicMethodEmitCalliNonBlittable() { string input = "Test string!", result = "!gnirts tseT"; diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitMethodInfo.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitMethodInfo.cs index 3940c1559b8040..c1f8357b6f25aa 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitMethodInfo.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitMethodInfo.cs @@ -15,6 +15,8 @@ public interface IWithIn { void Method(in int arg); } + + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class ILGeneratorEmitMethodInfo { [Fact] diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitWriteLineTests.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitWriteLineTests.cs index 392ecfda7fa2b9..50064318d3734d 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitWriteLineTests.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/EmitWriteLineTests.cs @@ -5,6 +5,7 @@ namespace System.Reflection.Emit.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class ILGeneratorEmitWriteLine { [Fact] diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs index e99a27e5470e73..60fd3266a5f776 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs @@ -7,7 +7,7 @@ namespace System.Reflection.Emit.Tests { public class ExceptionEmitTests { - [Fact] + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void TestExceptionEmitCalls() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.NotPublic); From 763579547150df15e52346a7220844a58f5ad623 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 27 May 2021 18:02:42 +0300 Subject: [PATCH 19/51] Avoid some test failures related to DebuggerSupport --- .../tests/System.Collections.Immutable.Tests.csproj | 2 +- .../tests/System.Collections.NonGeneric.Tests.csproj | 2 +- .../tests/System.Drawing.Primitives.Tests.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Collections.Immutable/tests/System.Collections.Immutable.Tests.csproj b/src/libraries/System.Collections.Immutable/tests/System.Collections.Immutable.Tests.csproj index 5dc59a38382154..3102debb7c3a13 100644 --- a/src/libraries/System.Collections.Immutable/tests/System.Collections.Immutable.Tests.csproj +++ b/src/libraries/System.Collections.Immutable/tests/System.Collections.Immutable.Tests.csproj @@ -2,7 +2,7 @@ 0436 $(NetCoreAppCurrent);net461 - true + true true $(NetCoreAppCurrent) - true + true diff --git a/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj b/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj index 53f60dbcb90928..68b3955aae7cd1 100644 --- a/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj +++ b/src/libraries/System.Drawing.Primitives/tests/System.Drawing.Primitives.Tests.csproj @@ -1,7 +1,7 @@ $(NetCoreAppCurrent) - true + true From dad7cab44e6554cd49f726a6103343959aba51ae Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 27 May 2021 18:03:34 +0300 Subject: [PATCH 20/51] Skip a test failing with NRE --- .../tests/Metadata/TagToTokenTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs index be0568e20ee1f0..aa0c8edcee583e 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs @@ -94,7 +94,7 @@ private IEnumerable GetTags() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsAndroid))] public void ValidateTagToTokenConversion() { foreach (var tag in GetTags()) From b3ceed5e7b6580aed5ae0218c41fbbf839c4058c Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Thu, 27 May 2021 16:05:53 -0400 Subject: [PATCH 21/51] Move ConditionalClass up to the right level --- .../tests/ILGenerator/ExceptionEmitTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs index 60fd3266a5f776..743c806a190009 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/tests/ILGenerator/ExceptionEmitTests.cs @@ -5,9 +5,9 @@ namespace System.Reflection.Emit.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class ExceptionEmitTests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void TestExceptionEmitCalls() { TypeBuilder type = Helpers.DynamicType(TypeAttributes.NotPublic); From db003613f44a4092163970174db1fe0e15b0ee8b Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Fri, 28 May 2021 18:43:26 +0300 Subject: [PATCH 22/51] More skipped tests --- .../TestUtilities/System/PlatformDetection.cs | 1 + .../tests/Metadata/TagToTokenTests.cs | 3 +- .../tests/BinaryResourceWriterUnitTest.cs | 9 +- .../tests/ResourceReaderUnitTest.cs | 2 +- .../IDispatchImplAttributeTests.cs | 1 + .../GetDelegateForFunctionPointerTests.cs | 8 +- .../GetFunctionPointerForDelegateTests.cs | 8 +- .../Marshal/IsComObjectTests.cs | 2 +- .../Marshal/PtrToStructureTests.cs | 4 +- ...etWin32ContextInIDispatchAttributeTests.cs | 1 + .../tests/DataContractJsonSerializer.cs | 8 +- .../tests/DataContractSerializer.cs | 376 +++++++++--------- .../tests/XmlDictionaryWriterTest.cs | 2 +- 13 files changed, 215 insertions(+), 210 deletions(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index bc5a2da1ae286f..bf76633031014c 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -29,6 +29,7 @@ public static partial class PlatformDetection public static bool IsNetBSD => RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")); public static bool IsAndroid => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID")); public static bool IsiOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")); + public static bool IsNotAndroidAOT => !(IsAndroid && IsMonoAOT); public static bool IsNotDeviceAOT => !((IsAndroid || IsiOS) && IsMonoAOT); public static bool IstvOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")); public static bool IsMacCatalyst => RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST")); diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs index aa0c8edcee583e..19e7babec58b7c 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs @@ -94,7 +94,8 @@ private IEnumerable GetTags() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsAndroid))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAndroid))] public void ValidateTagToTokenConversion() { foreach (var tag in GetTags()) diff --git a/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs b/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs index 378a416210d620..bf134a587f7e7d 100644 --- a/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs +++ b/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs @@ -339,7 +339,8 @@ public static void BinaryFormattedResourcesWithoutTypeName() } } } - [Fact] + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : ResourceManager_ReflectionNotAllowed [ActiveIssue("https://github.com/dotnet/runtime/issues/34495", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public static void TypeConverterByteArrayResources() { @@ -372,7 +373,7 @@ public static void TypeConverterByteArrayResources() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : ResourceManager_ReflectionNotAllowed public static void TypeConverterStringResources() { var values = TestData.StringConverter; @@ -402,7 +403,7 @@ public static void TypeConverterStringResources() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : ResourceManager_ReflectionNotAllowed [ActiveIssue("https://github.com/dotnet/runtime/issues/34495", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [ActiveIssue("https://github.com/dotnet/runtime/issues/34008", TestPlatforms.Linux, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public static void StreamResources() @@ -468,7 +469,7 @@ public static void CanReadViaResourceManager() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : ResourceManager_ReflectionNotAllowed public static void ResourceManagerLoadsCorrectReader() { ResourceManager resourceManager = new ResourceManager(typeof(TestData)); diff --git a/src/libraries/System.Resources.Reader/tests/ResourceReaderUnitTest.cs b/src/libraries/System.Resources.Reader/tests/ResourceReaderUnitTest.cs index ec22708125ab66..65c9bd6bbaadc8 100644 --- a/src/libraries/System.Resources.Reader/tests/ResourceReaderUnitTest.cs +++ b/src/libraries/System.Resources.Reader/tests/ResourceReaderUnitTest.cs @@ -263,7 +263,7 @@ public static void Exception_Enumerator_Value() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : ResourceManager_ReflectionNotAllowed [ActiveIssue("https://github.com/dotnet/runtime/issues/51833", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] public static void ReadV1Resources() { diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs index 59274bd8a298f8..e2378509c3f8c2 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs @@ -13,6 +13,7 @@ public class IDispatchImplAttributeTests [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/50717", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50717", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAndroid))] [InlineData(-1)] [InlineData(0)] [InlineData(2)] diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs index c11c75545d10f9..1747260a3d1865 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs @@ -13,7 +13,7 @@ namespace System.Runtime.InteropServices.Tests [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public class GetDelegateForFunctionPointerTests { - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(typeof(NonGenericDelegate))] [InlineData(typeof(MulticastDelegate))] [InlineData(typeof(OtherNonGenericDelegate))] @@ -51,7 +51,7 @@ public void GetDelegateForFunctionPointer_CollectibleType_ReturnsExpected() VerifyDelegate(functionDelegate, targetMethod); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDelegateForFunctionPointer_Generic_ReturnsExpected() { MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); @@ -63,7 +63,7 @@ public void GetDelegateForFunctionPointer_Generic_ReturnsExpected() VerifyDelegate(functionDelegate, targetMethod); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDelegateForFunctionPointer_GenericInvalidType_ReturnsExpected() { MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); @@ -139,7 +139,7 @@ public void GetDelegateForFunctionPointer_InvalidType_ThrowsArgumentException(Ty AssertExtensions.Throws("t", () => Marshal.GetDelegateForFunctionPointer((IntPtr)1, t)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDelegateForFunctionPointer_CantCast_ThrowsInvalidCastException() { MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs index 85328ac8026965..2114bb06f2d0c8 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetFunctionPointerForDelegateTests.cs @@ -10,7 +10,7 @@ namespace System.Runtime.InteropServices.Tests { public class GetFunctionPointerForDelegateTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_NormalDelegateNonGeneric_ReturnsExpected() { @@ -23,7 +23,7 @@ public void GetFunctionPointerForDelegate_NormalDelegateNonGeneric_ReturnsExpect Assert.Equal(pointer1, pointer2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_MarshalledDelegateNonGeneric_ReturnsExpected() { @@ -40,7 +40,7 @@ public void GetFunctionPointerForDelegate_MarshalledDelegateNonGeneric_ReturnsEx Assert.Equal(pointer1, pointer2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_NormalDelegateGeneric_ReturnsExpected() { @@ -53,7 +53,7 @@ public void GetFunctionPointerForDelegate_NormalDelegateGeneric_ReturnsExpected( Assert.Equal(pointer1, pointer2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/39187", TestPlatforms.Browser)] public void GetFunctionPointerForDelegate_MarshalledDelegateGeneric_ReturnsExpected() { diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/IsComObjectTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/IsComObjectTests.cs index 456f68f7ad797d..ec00bb1d4dbfaf 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/IsComObjectTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/IsComObjectTests.cs @@ -53,7 +53,7 @@ public static IEnumerable IsComObject_TestData() yield return new object[] { collectibleComImportObject }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(IsComObject_TestData))] public void IsComObject_NonComObject_ReturnsFalse(object value) { diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs index 86cd412fec99ad..fcc4b109095960 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs @@ -63,7 +63,7 @@ public void StructureToPtr_GenericType_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StructureToPtr_NonGenericObject_ReturnsExpected() { var structure = new SomeTestStruct @@ -89,7 +89,7 @@ public void StructureToPtr_NonGenericObject_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StructureToPtr_GenericObject_ReturnsExpected() { var structure = new SomeTestStruct diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs index 10149bdc8e007f..9cdd16891fb8fa 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs @@ -12,6 +12,7 @@ public class SetWin32ContextInIDispatchAttributeTests [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAndroid))] public void Ctor_Default_ExistsInSrc() { Type type = typeof(HandleCollector).Assembly.GetType(TypeName); diff --git a/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs b/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs index 87cd3085c99e3f..4aa88302ef0fe7 100644 --- a/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs +++ b/src/libraries/System.Runtime.Serialization.Json/tests/DataContractJsonSerializer.cs @@ -1389,7 +1389,7 @@ public static void DCJS_EmptyString_Throws() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCJS_ClassWithDatetimeOffsetTypeProperty() { var value = new TypeWithDateTimeOffsetTypeProperty() { ModifiedTime = new DateTimeOffset(new DateTime(2013, 1, 2, 3, 4, 5, 6, DateTimeKind.Utc)) }; @@ -1457,7 +1457,7 @@ public static void DCJS_TypeWithGenericDictionaryAsKnownType() Assert.StrictEqual(2, deserializedValue.Foo[20].LevelNo); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCJS_TypeWithKnownTypeAttributeAndInterfaceMember() { TypeWithKnownTypeAttributeAndInterfaceMember value = new TypeWithKnownTypeAttributeAndInterfaceMember(); @@ -1468,7 +1468,7 @@ public static void DCJS_TypeWithKnownTypeAttributeAndInterfaceMember() Assert.Equal("Foo News", deserializedValue.HeadLine.Title); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCJS_TypeWithKnownTypeAttributeAndListOfInterfaceMember() { TypeWithKnownTypeAttributeAndListOfInterfaceMember value = new TypeWithKnownTypeAttributeAndListOfInterfaceMember(); @@ -2559,7 +2559,7 @@ public static void DCJS_VerifyDateTimeForFormatStringDCJsonSerSetting() Assert.Equal(value, actual); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCJS_VerifyDateTimeForFormatStringDCJsonSerSettings() { var jsonTypes = new JsonTypes(); diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs index d1ce413b3dfac0..f7600a8602dd69 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/DataContractSerializer.cs @@ -34,7 +34,7 @@ static DataContractSerializerTests() method.Invoke(null, new object[] { 1 }); } #endif - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DateTimeOffsetAsRoot() { // Assume that UTC offset doesn't change more often than once in the day 2013-01-02 @@ -261,7 +261,7 @@ public static void DCS_UriAsRoot() Assert.StrictEqual(DataContractSerializerHelper.SerializeAndDeserialize(new Uri("http://abc/def/x.aspx?p1=12&p2=34"), @"http://abc/def/x.aspx?p1=12&p2=34"), new Uri("http://abc/def/x.aspx?p1=12&p2=34")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayAsRoot() { SimpleType[] x = new SimpleType[] { new SimpleType { P1 = "abc", P2 = 11 }, new SimpleType { P1 = "def", P2 = 12 } }; @@ -270,7 +270,7 @@ public static void DCS_ArrayAsRoot() Utils.Equal(x, y, (a, b) => { return SimpleType.AreEqual(a, b); }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayAsGetSet() { TypeWithGetSetArrayMembers x = new TypeWithGetSetArrayMembers @@ -289,7 +289,7 @@ public static void DCS_ArrayAsGetSet() Assert.Equal(x.P2, y.P2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayAsGetOnly() { TypeWithGetOnlyArrayProperties x = new TypeWithGetOnlyArrayProperties(); @@ -305,7 +305,7 @@ public static void DCS_ArrayAsGetOnly() Assert.Equal(x.P2, y.P2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DictionaryGenericRoot() { Dictionary x = new Dictionary(); @@ -320,7 +320,7 @@ public static void DCS_DictionaryGenericRoot() Assert.True(y["two"] == 2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DictionaryGenericMembers() { TypeWithDictionaryGenericMembers x = new TypeWithDictionaryGenericMembers @@ -379,7 +379,7 @@ public static void DCS_DictionaryGenericMembers() Assert.True(y.RO2[false] == 'b'); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DictionaryRoot() { MyDictionary x = new MyDictionary(); @@ -394,7 +394,7 @@ public static void DCS_DictionaryRoot() Assert.True((string)y[2] == "two"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DictionaryMembers() { TypeWithDictionaryMembers x = new TypeWithDictionaryMembers(); @@ -455,7 +455,7 @@ public static void DCS_DictionaryMembers() Assert.True((char)y.RO2[false] == 'b'); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithIDictionaryPropertyInitWithConcreteType() { // Test for Bug 876869 : [Serialization] Concrete type not inferred for DCS @@ -473,7 +473,7 @@ public static void DCS_TypeWithIDictionaryPropertyInitWithConcreteType() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ListGenericRoot() { List x = new List(); @@ -488,7 +488,7 @@ public static void DCS_ListGenericRoot() Assert.True(y[1] == "one"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ListGenericMembers() { TypeWithListGenericMembers x = new TypeWithListGenericMembers(); @@ -549,7 +549,7 @@ public static void DCS_ListGenericMembers() Assert.True(y.RO2[1] == 'd'); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionGenericRoot() { MyCollection x = new MyCollection("a1", "a2"); @@ -563,7 +563,7 @@ public static void DCS_CollectionGenericRoot() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionGenericMembers() { TypeWithCollectionGenericMembers x = new TypeWithCollectionGenericMembers @@ -614,7 +614,7 @@ public static void DCS_CollectionGenericMembers() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ListRoot() { MyList x = new MyList("a1", "a2"); @@ -629,7 +629,7 @@ public static void DCS_ListRoot() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ListMembers() { TypeWithListMembers x = new TypeWithListMembers @@ -663,7 +663,7 @@ public static void DCS_ListMembers() Assert.True((string)x.RO2[0] == (string)y.RO2[0], getCheckFailureMsg("RO2")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableGenericRoot() { MyEnumerable x = new MyEnumerable("a1", "a2"); @@ -676,7 +676,7 @@ public static void DCS_EnumerableGenericRoot() Assert.Equal("a1a2", actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableGenericMembers() { TypeWithEnumerableGenericMembers x = new TypeWithEnumerableGenericMembers @@ -698,7 +698,7 @@ public static void DCS_EnumerableGenericMembers() Assert.True(y.RO1.Count == 1); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionRoot() { MyCollection x = new MyCollection('a', 45); @@ -710,7 +710,7 @@ public static void DCS_CollectionRoot() Assert.True((int)y[1] == 45); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionMembers() { TypeWithCollectionMembers x = new TypeWithCollectionMembers @@ -747,7 +747,7 @@ public static void DCS_CollectionMembers() Assert.True((string)y.RO1[0] == "abc"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableRoot() { MyEnumerable x = new MyEnumerable("abc", 3); @@ -759,7 +759,7 @@ public static void DCS_EnumerableRoot() Assert.True((int)y[1] == 3); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableMembers() { TypeWithEnumerableMembers x = new TypeWithEnumerableMembers @@ -794,7 +794,7 @@ public static void DCS_EnumerableMembers() Assert.True((char)y.RO1[0] == 'x'); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableMemberConcreteTypeWithoutDefaultContructor() { TypeWithEnumerableMembers x = new TypeWithEnumerableMembers @@ -821,7 +821,7 @@ public static void DCS_EnumerableMemberConcreteTypeWithoutDefaultContructor() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CustomType() { MyTypeA x = new MyTypeA @@ -839,7 +839,7 @@ public static void DCS_CustomType() Assert.StrictEqual(x.PropY, y.PropY); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithPrivateFieldAndPrivateGetPublicSetProperty() { TypeWithPrivateFieldAndPrivateGetPublicSetProperty x = new TypeWithPrivateFieldAndPrivateGetPublicSetProperty @@ -851,7 +851,7 @@ public static void DCS_TypeWithPrivateFieldAndPrivateGetPublicSetProperty() Assert.Null(y.GetName()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataContractAttribute() { DataContractSerializerHelper.SerializeAndDeserialize(new DCA_1 { P1 = "xyz" }, @""); @@ -861,13 +861,13 @@ public static void DCS_DataContractAttribute() DataContractSerializerHelper.SerializeAndDeserialize(new DCA_5 { P1 = "xyz" }, @""); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataMemberAttribute() { DataContractSerializerHelper.SerializeAndDeserialize(new DMA_1 { P1 = "abc", P2 = 12, P3 = true, P4 = 'a', P5 = 10, MyDataMemberInAnotherNamespace = new MyDataContractClass04_1() { MyDataMember = "Test" }, Order100 = true, OrderMaxValue = false }, @"Testabc971012truetruefalse"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_IgnoreDataMemberAttribute() { IDMA_1 x = new IDMA_1 { MyDataMember = "MyDataMember", MyIgnoreDataMember = "MyIgnoreDataMember", MyUnsetDataMember = "MyUnsetDataMember" }; @@ -892,7 +892,7 @@ public static void DCS_EnumAsRoot() Assert.StrictEqual(ULongEnum.Option1, DataContractSerializerHelper.SerializeAndDeserialize(ULongEnum.Option1, @"Option1")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumAsMember() { TypeWithEnumMembers x = new TypeWithEnumMembers { F1 = MyEnum.Three, P1 = MyEnum.Two }; @@ -903,7 +903,7 @@ public static void DCS_EnumAsMember() Assert.StrictEqual(x.P1, y.P1); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DCClassWithEnumAndStruct() { var x = new DCClassWithEnumAndStruct(true); @@ -913,7 +913,7 @@ public static void DCS_DCClassWithEnumAndStruct() Assert.StrictEqual(x.MyEnum1, y.MyEnum1); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SuspensionManager() { var x = new Dictionary(); @@ -928,7 +928,7 @@ public static void DCS_SuspensionManager() Assert.Equal("subkey1value", ((y["Key1"] as Dictionary)["subkey1"]) as string); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BuiltInTypes() { BuiltInTypes x = new BuiltInTypes @@ -941,14 +941,14 @@ public static void DCS_BuiltInTypes() Assert.Equal(x.ByteArray, y.ByteArray); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CircularLink() { CircularLinkDerived circularLinkDerived = new CircularLinkDerived(true); DataContractSerializerHelper.SerializeAndDeserialize(circularLinkDerived, @""); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataMemberNames() { var obj = new AppEnvironment() @@ -961,7 +961,7 @@ public static void DCS_DataMemberNames() Assert.Equal(obj.ScreenOrientation, actual.ScreenOrientation); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericBase() { var actual = DataContractSerializerHelper.SerializeAndDeserialize>(new GenericBase2(true), @""); @@ -970,13 +970,13 @@ public static void DCS_GenericBase() Assert.True(actual.genericData2 is SimpleBaseDerived2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericContainer() { DataContractSerializerHelper.SerializeAndDeserialize(new GenericContainer(true), @""); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DictionaryWithVariousKeyValueTypes() { var x = new DictionaryWithVariousKeyValueTypes(true); @@ -992,7 +992,7 @@ public static void DCS_DictionaryWithVariousKeyValueTypes() Assert.Null(y.WithNullables[short.MaxValue]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypesWithArrayOfOtherTypes() { var x = new TypeHasArrayOfASerializedAsB(true); @@ -1002,7 +1002,7 @@ public static void DCS_TypesWithArrayOfOtherTypes() Assert.Equal(x.Items[1].Name, y.Items[1].Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WithDuplicateNames() { var x = new WithDuplicateNames(true); @@ -1015,7 +1015,7 @@ public static void DCS_WithDuplicateNames() Assert.StrictEqual(x.StructA2, y.StructA2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_XElementAsRoot() { var original = new XElement("ElementName1"); @@ -1026,7 +1026,7 @@ public static void DCS_XElementAsRoot() VerifyXElementObject(original, actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WithXElement() { var original = new WithXElement(true); @@ -1046,7 +1046,7 @@ private static void VerifyXElementObject(XElement x1, XElement x2, bool checkFir } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WithXElementWithNestedXElement() { var original = new WithXElementWithNestedXElement(true); @@ -1056,7 +1056,7 @@ public static void DCS_WithXElementWithNestedXElement() VerifyXElementObject((XElement)original.e1.FirstNode, (XElement)actual.e1.FirstNode); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WithArrayOfXElement() { var original = new WithArrayOfXElement(true); @@ -1068,7 +1068,7 @@ public static void DCS_WithArrayOfXElement() VerifyXElementObject(original.a[2], actual.a[2], checkFirstAttribute: false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WithListOfXElement() { var original = new WithListOfXElement(true); @@ -1080,7 +1080,7 @@ public static void DCS_WithListOfXElement() VerifyXElementObject(original.list[2], actual.list[2], checkFirstAttribute: false); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/51679", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoAOT))] public static void DCS_DerivedTypeWithDifferentOverrides() { @@ -1094,7 +1094,7 @@ public static void DCS_DerivedTypeWithDifferentOverrides() Assert.Equal(x.Name5, y.Name5); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeNamesWithSpecialCharacters() { var x = new __TypeNameWithSpecialCharacters\u6F22\u00F1() { PropertyNameWithSpecialCharacters\u6F22\u00F1 = "Test" }; @@ -1103,7 +1103,7 @@ public static void DCS_TypeNamesWithSpecialCharacters() Assert.Equal(x.PropertyNameWithSpecialCharacters\u6F22\u00F1, y.PropertyNameWithSpecialCharacters\u6F22\u00F1); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_JaggedArrayAsRoot() { int[][] jaggedIntegerArray = new int[][] { new int[] { 1, 3, 5, 7, 9 }, new int[] { 0, 2, 4, 6 }, new int[] { 11, 22 } }; @@ -1140,7 +1140,7 @@ public static void DCS_JaggedArrayAsRoot() Assert.True(actualJaggedIntegerArray2[2][0].Length == 0); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MyDataContractResolver() { var myresolver = new MyResolver(); @@ -1157,7 +1157,7 @@ public static void DCS_MyDataContractResolver() Assert.True(output.OnDeserializedMethodInvoked, "output.OnDeserializedMethodInvoked is false"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_WriteObject_Use_DataContractResolver() { var settings = new DataContractSerializerSettings() { DataContractResolver = null, KnownTypes = new Type[] { typeof(MyOtherType) } }; @@ -1198,7 +1198,7 @@ public static void DCS_DataContractResolver_Property() Assert.Equal(myresolver, dcs.DataContractResolver); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableStruct() { var original = new EnumerableStruct(); @@ -1210,7 +1210,7 @@ public static void DCS_EnumerableStruct() Assert.Equal((IEnumerable)actual, (IEnumerable)original); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableCollection() { var original = new EnumerableCollection(); @@ -1223,7 +1223,7 @@ public static void DCS_EnumerableCollection() Assert.Equal((IEnumerable)actual, (IEnumerable)original); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BaseClassAndDerivedClassWithSameProperty() { var value = new DerivedClassWithSameProperty() { DateTimeProperty = new DateTime(100), IntProperty = 5, StringProperty = "TestString", ListProperty = new List() }; @@ -1240,7 +1240,7 @@ public static void DCS_BaseClassAndDerivedClassWithSameProperty() Assert.Equal("three", actual.ListProperty[2]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ContainsLinkedList() { var value = new ContainsLinkedList(true); @@ -1248,7 +1248,7 @@ public static void DCS_ContainsLinkedList() DataContractSerializerHelper.SerializeAndDeserialize(value, @"23:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:5923:59:59"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SimpleCollectionDataContract() { var value = new SimpleCDC(true); @@ -1260,7 +1260,7 @@ public static void DCS_SimpleCollectionDataContract() Assert.Contains("Three", actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MyDerivedCollectionContainer() { var value = new MyDerivedCollectionContainer(); @@ -1278,7 +1278,7 @@ public static void DCS_EnumFlags() Assert.StrictEqual(value1, value2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SerializeClassThatImplementsInteface() { ClassImplementsInterface value = new ClassImplementsInterface() { ClassID = "ClassID", DisplayName = "DisplayName", Id = "Id", IsLoaded = true }; @@ -1289,7 +1289,7 @@ public static void DCS_SerializeClassThatImplementsInteface() Assert.Equal(value.Id, actual.Id); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_Nullables() { // Arrange @@ -1315,7 +1315,7 @@ public static void DCS_Nullables() Assert.StrictEqual(item.Struct1.Value.B, actual.Struct1.Value.B); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SimpleStructWithProperties() { SimpleStructWithProperties x = new SimpleStructWithProperties() { Num = 1, Text = "Foo" }; @@ -1325,7 +1325,7 @@ public static void DCS_SimpleStructWithProperties() Assert.True(x.Text == y.Text, "x.Text != y.Text"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_InternalTypeSerialization() { var value = new InternalType() { InternalProperty = 12 }; @@ -1334,7 +1334,7 @@ public static void DCS_InternalTypeSerialization() Assert.StrictEqual(deserializedValue.GetPrivatePropertyValue(), value.GetPrivatePropertyValue()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_PrivateTypeSerialization() { var value = new PrivateType(); @@ -1371,7 +1371,7 @@ public int GetPrivatePropertyValue() } #endregion - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_RootNameAndNamespaceThroughConstructorAsString() { //Constructor# 3 @@ -1382,7 +1382,7 @@ public static void DCS_RootNameAndNamespaceThroughConstructorAsString() Assert.Equal("Hello", result.Str); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_RootNameAndNamespaceThroughConstructorAsXmlDictionary() { //Constructor# 4 @@ -1394,7 +1394,7 @@ public static void DCS_RootNameAndNamespaceThroughConstructorAsXmlDictionary() Assert.Equal("Hello", result.Str); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_KnownTypesThroughConstructor() { //Constructor# 5 @@ -1408,7 +1408,7 @@ public static void DCS_KnownTypesThroughConstructor() Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DuplicatedKnownTypesWithAdapterThroughConstructor() { //Constructor# 5 @@ -1423,7 +1423,7 @@ public static void DCS_DuplicatedKnownTypesWithAdapterThroughConstructor() Assert.StrictEqual((DateTimeOffset)actual.SimpleTypeValue, (DateTimeOffset)actual.SimpleTypeValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_KnownTypesThroughSettings() { //Constructor# 2.1 @@ -1437,7 +1437,7 @@ public static void DCS_KnownTypesThroughSettings() Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_RootNameNamespaceAndKnownTypesThroughConstructorAsStrings() { //Constructor# 6 @@ -1451,7 +1451,7 @@ public static void DCS_RootNameNamespaceAndKnownTypesThroughConstructorAsStrings Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_RootNameNamespaceAndKnownTypesThroughConstructorAsXmlDictionary() { //Constructor# 7 @@ -1466,7 +1466,7 @@ public static void DCS_RootNameNamespaceAndKnownTypesThroughConstructorAsXmlDict Assert.Equal("PropertyValue", ((SimpleKnownTypeValue)actual.SimpleTypeValue).StrProperty); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ExceptionObject() { var value = new Exception("Test Exception"); @@ -1479,7 +1479,7 @@ public static void DCS_ExceptionObject() Assert.Equal(value.HelpLink, actual.HelpLink); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MyArgumentExceptionObject() { var value = new MyArgumentException("Test Exception", "paramName"); @@ -1493,7 +1493,7 @@ public static void DCS_MyArgumentExceptionObject() Assert.Equal(value.HelpLink, actual.HelpLink); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ExceptionMessageWithSpecialChars() { var value = new Exception("Test Exception<>&'\""); @@ -1506,7 +1506,7 @@ public static void DCS_ExceptionMessageWithSpecialChars() Assert.Equal(value.HelpLink, actual.HelpLink); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_InnerExceptionMessageWithSpecialChars() { var value = new Exception("", new Exception("Test Exception<>&'\"")); @@ -1525,7 +1525,7 @@ public static void DCS_InnerExceptionMessageWithSpecialChars() Assert.Equal(value.InnerException.HelpLink, actual.InnerException.HelpLink); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithUriTypeProperty() { var value = new TypeWithUriTypeProperty() { ConfigUri = new Uri("http://www.bing.com") }; @@ -1535,7 +1535,7 @@ public static void DCS_TypeWithUriTypeProperty() Assert.StrictEqual(value.ConfigUri, actual.ConfigUri); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithDatetimeOffsetTypeProperty() { var value = new TypeWithDateTimeOffsetTypeProperty() { ModifiedTime = new DateTimeOffset(new DateTime(2013, 1, 2, 3, 4, 5, 6, DateTimeKind.Utc)) }; @@ -1555,7 +1555,7 @@ public static void DCS_TypeWithDatetimeOffsetTypeProperty() Assert.StrictEqual(value.ModifiedTime, actual.ModifiedTime); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_Tuple() { DCS_Tuple1(); @@ -1624,7 +1624,7 @@ private static void DCS_Tuple8() Assert.StrictEqual>>(value, deserializedValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericQueue() { Queue value = new Queue(); @@ -1637,7 +1637,7 @@ public static void DCS_GenericQueue() Assert.StrictEqual(a1[0], a2[0]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericStack() { var value = new Stack(); @@ -1652,7 +1652,7 @@ public static void DCS_GenericStack() Assert.StrictEqual(a1[1], a2[1]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_Queue() { var value = new Queue(); @@ -1666,7 +1666,7 @@ public static void DCS_Queue() Assert.StrictEqual(a1[0], a2[0]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_Stack() { var value = new Stack(); @@ -1681,7 +1681,7 @@ public static void DCS_Stack() Assert.StrictEqual(a1[1], a2[1]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SortedList() { var value = new SortedList(); @@ -1693,7 +1693,7 @@ public static void DCS_SortedList() Assert.StrictEqual(value[1], deserializedValue[1]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SystemVersion() { Version value = new Version(1, 2, 3, 4); @@ -1705,7 +1705,7 @@ public static void DCS_SystemVersion() Assert.StrictEqual(value.Revision, deserializedValue.Revision); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithCommonTypeProperties() { TypeWithCommonTypeProperties value = new TypeWithCommonTypeProperties { Ts = new TimeSpan(1, 1, 1), Id = new Guid("ad948f1e-9ba9-44c8-8e2e-b6ba969ec987") }; @@ -1713,7 +1713,7 @@ public static void DCS_TypeWithCommonTypeProperties() Assert.StrictEqual(value, deserializedValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithTypeProperty() { TypeWithTypeProperty value = new TypeWithTypeProperty { Id = 123, Name = "Jon Doe" }; @@ -1723,7 +1723,7 @@ public static void DCS_TypeWithTypeProperty() Assert.StrictEqual(value.Type, deserializedValue.Type); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithExplicitIEnumerableImplementation() { TypeWithExplicitIEnumerableImplementation value = new TypeWithExplicitIEnumerableImplementation { }; @@ -1738,7 +1738,7 @@ public static void DCS_TypeWithExplicitIEnumerableImplementation() Assert.Equal("Bar", (string)enumerator.Current); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithGenericDictionaryAsKnownType() { TypeWithGenericDictionaryAsKnownType value = new TypeWithGenericDictionaryAsKnownType { }; @@ -1753,7 +1753,7 @@ public static void DCS_TypeWithGenericDictionaryAsKnownType() Assert.StrictEqual(2, deserializedValue.Foo[20].LevelNo); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithKnownTypeAttributeAndInterfaceMember() { TypeWithKnownTypeAttributeAndInterfaceMember value = new TypeWithKnownTypeAttributeAndInterfaceMember(); @@ -1764,7 +1764,7 @@ public static void DCS_TypeWithKnownTypeAttributeAndInterfaceMember() Assert.Equal("Foo News", deserializedValue.HeadLine.Title); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithKnownTypeAttributeAndListOfInterfaceMember() { TypeWithKnownTypeAttributeAndListOfInterfaceMember value = new TypeWithKnownTypeAttributeAndListOfInterfaceMember(); @@ -1780,7 +1780,7 @@ public static void DCS_TypeWithKnownTypeAttributeAndListOfInterfaceMember() * Begin tests of the InvalidDataContract generated for illegal types */ - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_InvalidDataContract_Write_And_Read_Empty_Collection_Of_Invalid_Type_Succeeds() { // Collections of invalid types can be serialized and deserialized if they are empty. @@ -1815,7 +1815,7 @@ public static void DCS_InvalidDataContract_Write_NonEmpty_Collection_Of_Invalid_ * End tests of the InvalidDataContract generated for illegal types */ - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DerivedTypeWithBaseTypeWithDataMember() { DerivedTypeWithDataMemberInBaseType value = new DerivedTypeWithDataMemberInBaseType() { EmbeddedDataMember = new TypeAsEmbeddedDataMember { Name = "Foo" } }; @@ -1824,7 +1824,7 @@ public static void DCS_DerivedTypeWithBaseTypeWithDataMember() Assert.Equal("Foo", deserializedValue.EmbeddedDataMember.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_PocoDerivedTypeWithBaseTypeWithDataMember() { PocoDerivedTypeWithDataMemberInBaseType value = new PocoDerivedTypeWithDataMemberInBaseType() { EmbeddedDataMember = new PocoTypeAsEmbeddedDataMember { Name = "Foo" } }; @@ -1833,7 +1833,7 @@ public static void DCS_PocoDerivedTypeWithBaseTypeWithDataMember() Assert.Equal("Foo", deserializedValue.EmbeddedDataMember.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ClassImplementingIXmlSerialiable() { ClassImplementingIXmlSerialiable value = new ClassImplementingIXmlSerialiable() { StringValue = "Foo" }; @@ -1841,7 +1841,7 @@ public static void DCS_ClassImplementingIXmlSerialiable() Assert.Equal(value.StringValue, deserializedValue.StringValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithNestedGenericClassImplementingIXmlSerialiable() { TypeWithNestedGenericClassImplementingIXmlSerialiable.NestedGenericClassImplementingIXmlSerialiable value = new TypeWithNestedGenericClassImplementingIXmlSerialiable.NestedGenericClassImplementingIXmlSerialiable() { StringValue = "Foo" }; @@ -1849,7 +1849,7 @@ public static void DCS_TypeWithNestedGenericClassImplementingIXmlSerialiable() Assert.Equal(value.StringValue, deserializedValue.StringValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericTypeWithNestedGenerics() { GenericTypeWithNestedGenerics.InnerGeneric value = new GenericTypeWithNestedGenerics.InnerGeneric() @@ -1862,7 +1862,7 @@ public static void DCS_GenericTypeWithNestedGenerics() Assert.StrictEqual(value.data2, deserializedValue.data2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DuplicatedKeyDateTimeOffset() { DateTimeOffset value = new DateTimeOffset(new DateTime(2013, 1, 2, 3, 4, 5, 6, DateTimeKind.Utc).AddMinutes(7)); @@ -1873,7 +1873,7 @@ public static void DCS_DuplicatedKeyDateTimeOffset() dcjs.WriteObject(stream, value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DuplicatedKeyXmlQualifiedName() { XmlQualifiedName qname = new XmlQualifiedName("abc", "def"); @@ -1882,7 +1882,7 @@ public static void DCS_DuplicatedKeyXmlQualifiedName() Assert.StrictEqual(value.Value, deserialized.Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DeserializeTypeWithInnerInvalidDataContract() { DataContractSerializer dcs = new DataContractSerializer(typeof(TypeWithPropertyWithoutDefaultCtor)); @@ -1898,7 +1898,7 @@ public static void DCS_DeserializeTypeWithInnerInvalidDataContract() Assert.Null(deserializedValue.MemberWithInvalidDataContract); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ReadOnlyCollection() { List list = new List() { "Foo", "Bar" }; @@ -1909,7 +1909,7 @@ public static void DCS_ReadOnlyCollection() Assert.Equal(value[1], deserializedValue[1]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ReadOnlyDictionary() { var dict = new Dictionary(); @@ -1923,7 +1923,7 @@ public static void DCS_ReadOnlyDictionary() Assert.StrictEqual(value["Bar"], deserializedValue["Bar"]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_KeyValuePair() { var value = new KeyValuePair("FooKey", "FooValue"); @@ -1933,7 +1933,7 @@ public static void DCS_KeyValuePair() Assert.StrictEqual(value.Value, deserializedValue.Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ConcurrentDictionary() { var value = new ConcurrentDictionary(); @@ -1947,7 +1947,7 @@ public static void DCS_ConcurrentDictionary() Assert.True(deserializedValue["two"] == 2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataContractWithDotInName() { DataContractWithDotInName value = new DataContractWithDotInName() { Name = "Foo" }; @@ -1957,7 +1957,7 @@ public static void DCS_DataContractWithDotInName() Assert.Equal(value.Name, deserializedValue.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataContractWithMinusSignInName() { DataContractWithMinusSignInName value = new DataContractWithMinusSignInName() { Name = "Foo" }; @@ -1967,7 +1967,7 @@ public static void DCS_DataContractWithMinusSignInName() Assert.Equal(value.Name, deserializedValue.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataContractWithOperatorsInName() { DataContractWithOperatorsInName value = new DataContractWithOperatorsInName() { Name = "Foo" }; @@ -1977,7 +1977,7 @@ public static void DCS_DataContractWithOperatorsInName() Assert.Equal(value.Name, deserializedValue.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DataContractWithOtherSymbolsInName() { DataContractWithOtherSymbolsInName value = new DataContractWithOtherSymbolsInName() { Name = "Foo" }; @@ -1987,7 +1987,7 @@ public static void DCS_DataContractWithOtherSymbolsInName() Assert.Equal(value.Name, deserializedValue.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionDataContractWithCustomKeyName() { CollectionDataContractWithCustomKeyName value = new CollectionDataContractWithCustomKeyName(); @@ -2000,7 +2000,7 @@ public static void DCS_CollectionDataContractWithCustomKeyName() Assert.StrictEqual(value[200], deserializedValue[200]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionDataContractWithCustomKeyNameDuplicate() { CollectionDataContractWithCustomKeyNameDuplicate value = new CollectionDataContractWithCustomKeyNameDuplicate(); @@ -2013,7 +2013,7 @@ public static void DCS_CollectionDataContractWithCustomKeyNameDuplicate() Assert.StrictEqual(value[200], deserializedValue[200]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithCollectionWithoutDefaultConstructor() { TypeWithCollectionWithoutDefaultConstructor value = new TypeWithCollectionWithoutDefaultConstructor(); @@ -2057,7 +2057,7 @@ public static void DCS_DeserializeEmptyString() Assert.True(exceptionThrown, "An expected exception was not thrown."); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(XmlDictionaryReaderQuotasData))] public static void DCS_XmlDictionaryQuotas(XmlDictionaryReaderQuotas quotas, bool shouldSucceed) { @@ -2092,7 +2092,7 @@ public static IEnumerable XmlDictionaryReaderQuotasData } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionInterfaceGetOnlyCollection() { var obj = new TypeWithCollectionInterfaceGetOnlyCollection(new List() { "item1", "item2", "item3" }); @@ -2100,7 +2100,7 @@ public static void DCS_CollectionInterfaceGetOnlyCollection() Assert.Equal(obj.Items, deserializedObj.Items); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_EnumerableInterfaceGetOnlyCollection() { // Expect exception in deserialization process @@ -2132,7 +2132,7 @@ public static void DCS_XmlElementAsRoot() Assert.Equal(expected.InnerText, actual.InnerText); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithXmlElementProperty() { XmlDocument xDoc = new XmlDocument(); @@ -2151,7 +2151,7 @@ public static void DCS_TypeWithXmlElementProperty() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfSimpleType_PreserveObjectReferences_True() { var x = new SimpleType[3]; @@ -2179,7 +2179,7 @@ public static void DCS_ArrayOfSimpleType_PreserveObjectReferences_True() Assert.True(x[2].P2 == y[2].P2, "x[2].P2 != y[2].P2"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfSimpleType_PreserveObjectReferences_False() { var x = new SimpleType[3]; @@ -2209,7 +2209,7 @@ public static void DCS_ArrayOfSimpleType_PreserveObjectReferences_False() Assert.True(x[2].P2 == y[2].P2, "x[2].P2 != y[2].P2"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CircularTypes_PreserveObjectReferences_True() { var root = new TypeWithListOfReferenceChildren(); @@ -2239,7 +2239,7 @@ public static void DCS_CircularTypes_PreserveObjectReferences_True() Assert.True(root2.Children[0] == root2.Children[2], "root2.Children[0] != root2.Children[2]"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CircularTypes_PreserveObjectReferences_False() { var root = new TypeWithListOfReferenceChildren(); @@ -2269,7 +2269,7 @@ public static void DCS_CircularTypes_PreserveObjectReferences_False() Assert.True(root2.Children[0] == root2.Children[2], "root2.Children[0] != root2.Children[2]"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithPrimitiveProperties() { TypeWithPrimitiveProperties x = new TypeWithPrimitiveProperties { P1 = "abc", P2 = 11 }; @@ -2278,7 +2278,7 @@ public static void DCS_TypeWithPrimitiveProperties() Assert.StrictEqual(x.P2, y.P2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithPrimitiveFields() { TypeWithPrimitiveFields x = new TypeWithPrimitiveFields { P1 = "abc", P2 = 11 }; @@ -2287,7 +2287,7 @@ public static void DCS_TypeWithPrimitiveFields() Assert.StrictEqual(x.P2, y.P2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithAllPrimitiveProperties() { TypeWithAllPrimitiveProperties x = new TypeWithAllPrimitiveProperties @@ -2319,7 +2319,7 @@ public static void DCS_TypeWithAllPrimitiveProperties() #region Array of primitive types - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfBoolean() { var value = new bool[] { true, false, true }; @@ -2328,7 +2328,7 @@ public static void DCS_ArrayOfBoolean() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfDateTime() { var value = new DateTime[] { new DateTime(2000, 1, 2, 3, 4, 5, DateTimeKind.Utc), new DateTime(2011, 2, 3, 4, 5, 6, DateTimeKind.Utc) }; @@ -2337,7 +2337,7 @@ public static void DCS_ArrayOfDateTime() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfDecimal() { var value = new decimal[] { new decimal(1, 2, 3, false, 1), new decimal(4, 5, 6, true, 2) }; @@ -2346,7 +2346,7 @@ public static void DCS_ArrayOfDecimal() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfInt32() { var value = new int[] { 123, int.MaxValue, int.MinValue }; @@ -2355,7 +2355,7 @@ public static void DCS_ArrayOfInt32() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfInt64() { var value = new long[] { 123, long.MaxValue, long.MinValue }; @@ -2364,7 +2364,7 @@ public static void DCS_ArrayOfInt64() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfSingle() { var value = new float[] { 1.23f, 4.56f, 7.89f }; @@ -2373,7 +2373,7 @@ public static void DCS_ArrayOfSingle() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfDouble() { var value = new double[] { 1.23, 4.56, 7.89 }; @@ -2382,7 +2382,7 @@ public static void DCS_ArrayOfDouble() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfString() { var value = new string[] { "abc", "def", "xyz" }; @@ -2391,7 +2391,7 @@ public static void DCS_ArrayOfString() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfTypeWithPrimitiveProperties() { var value = new TypeWithPrimitiveProperties[] @@ -2404,7 +2404,7 @@ public static void DCS_ArrayOfTypeWithPrimitiveProperties() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ArrayOfSimpleType() { // Intentionally set count to 64 to test array resizing functionality during de-serialization. @@ -2422,7 +2422,7 @@ public static void DCS_ArrayOfSimpleType() Assert.StrictEqual(count-1, deserialized[count-1].P2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithEmitDefaultValueFalse() { var value = new TypeWithEmitDefaultValueFalse(); @@ -2438,7 +2438,7 @@ public static void DCS_TypeWithEmitDefaultValueFalse() #region Collection - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfBoolean() { var value = new TypeImplementsGenericICollection() { true, false, true }; @@ -2447,7 +2447,7 @@ public static void DCS_GenericICollectionOfBoolean() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfDecimal() { var value = new TypeImplementsGenericICollection() { new decimal(1, 2, 3, false, 1), new decimal(4, 5, 6, true, 2) }; @@ -2456,7 +2456,7 @@ public static void DCS_GenericICollectionOfDecimal() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfInt32() { TypeImplementsGenericICollection x = new TypeImplementsGenericICollection(123, int.MaxValue, int.MinValue); @@ -2467,7 +2467,7 @@ public static void DCS_GenericICollectionOfInt32() Assert.True(x.SequenceEqual(y)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfInt64() { var value = new TypeImplementsGenericICollection() { 123, long.MaxValue, long.MinValue }; @@ -2476,7 +2476,7 @@ public static void DCS_GenericICollectionOfInt64() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfSingle() { var value = new TypeImplementsGenericICollection() { 1.23f, 4.56f, 7.89f }; @@ -2485,7 +2485,7 @@ public static void DCS_GenericICollectionOfSingle() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfDouble() { var value = new TypeImplementsGenericICollection() { 1.23, 4.56, 7.89 }; @@ -2494,7 +2494,7 @@ public static void DCS_GenericICollectionOfDouble() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfString() { TypeImplementsGenericICollection value = new TypeImplementsGenericICollection("a1", "a2"); @@ -2505,7 +2505,7 @@ public static void DCS_GenericICollectionOfString() Assert.True(value.SequenceEqual(deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericICollectionOfTypeWithPrimitiveProperties() { var value = new TypeImplementsGenericICollection() @@ -2518,7 +2518,7 @@ public static void DCS_GenericICollectionOfTypeWithPrimitiveProperties() Assert.True(Enumerable.SequenceEqual(value, deserialized)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_CollectionOfTypeWithNonDefaultNamcespace() { var value = new CollectionOfTypeWithNonDefaultNamcespace(); @@ -2534,7 +2534,7 @@ public static void DCS_CollectionOfTypeWithNonDefaultNamcespace() #region Generic Dictionary - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericDictionaryOfInt32Boolean() { var value = new Dictionary(); @@ -2545,7 +2545,7 @@ public static void DCS_GenericDictionaryOfInt32Boolean() Assert.True(Enumerable.SequenceEqual(value.ToArray(), deserialized.ToArray())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericDictionaryOfInt32String() { var value = new Dictionary(); @@ -2556,7 +2556,7 @@ public static void DCS_GenericDictionaryOfInt32String() Assert.True(Enumerable.SequenceEqual(value.ToArray(), deserialized.ToArray())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_GenericDictionaryOfStringInt32() { var value = new Dictionary(); @@ -2571,7 +2571,7 @@ public static void DCS_GenericDictionaryOfStringInt32() #region Non-Generic Dictionary - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_NonGenericDictionaryOfInt32Boolean() { var value = new MyNonGenericDictionary(); @@ -2583,7 +2583,7 @@ public static void DCS_NonGenericDictionaryOfInt32Boolean() Assert.True(Enumerable.SequenceEqual(value.Values.Cast().ToArray(), deserialized.Values.Cast().ToArray())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_NonGenericDictionaryOfInt32String() { var value = new MyNonGenericDictionary(); @@ -2595,7 +2595,7 @@ public static void DCS_NonGenericDictionaryOfInt32String() Assert.True(Enumerable.SequenceEqual(value.Values.Cast().ToArray(), deserialized.Values.Cast().ToArray())); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_NonGenericDictionaryOfStringInt32() { var value = new MyNonGenericDictionary(); @@ -2609,7 +2609,7 @@ public static void DCS_NonGenericDictionaryOfStringInt32() #endregion - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundTripResolveDTOTypes() { ObjectContainer instance = new ObjectContainer(new DTOContainer()); @@ -2629,7 +2629,7 @@ public static void DCS_BasicRoundTripResolveDTOTypes() Assert.Equal(DateTimeOffset.MaxValue, ((DTOContainer)deserialized.Data).nDTO); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ExtensionDataObjectTest() { var p2 = new PersonV2(); @@ -2672,7 +2672,7 @@ public static void DCS_ExtensionDataObjectTest() Assert.True(result2.Equal, $"{nameof(actualOutput2)} was not as expected: {Environment.NewLine}Expected: {baseline2}{Environment.NewLine}Actual: {actualOutput2}"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_XPathQueryGeneratorTest() { Type t = typeof(Order); @@ -2704,7 +2704,7 @@ public static void XsdDataContractExporterTest() Assert.Throws(() => exporter.Export(typeof(Employee))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MyISerializableType() { var value = new MyISerializableType(); @@ -2716,7 +2716,7 @@ public static void DCS_MyISerializableType() Assert.Equal(value.StringValue, actual.StringValue); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithNonSerializedField() { var value = new TypeWithSerializableAttributeAndNonSerializedField(); @@ -2736,7 +2736,7 @@ public static void DCS_TypeWithNonSerializedField() Assert.Null(actual.Member4); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithOptionalField() { var value = new TypeWithOptionalField(); @@ -2755,7 +2755,7 @@ public static void DCS_TypeWithOptionalField() Assert.Equal(0, deserialized.Member2); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SerializableEnumWithNonSerializedValue() { var value1 = new TypeWithSerializableEnum(); @@ -2769,7 +2769,7 @@ public static void DCS_SerializableEnumWithNonSerializedValue() Assert.Throws(() => DataContractSerializerHelper.SerializeAndDeserialize(value2, "")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SquareWithDeserializationCallback() { var value = new SquareWithDeserializationCallback(2); @@ -2778,7 +2778,7 @@ public static void DCS_SquareWithDeserializationCallback() Assert.Equal(value.Area, actual.Area); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithDelegate() { var value = new TypeWithDelegate(); @@ -2791,7 +2791,7 @@ public static void DCS_TypeWithDelegate() #region DesktopTest - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ResolveNameReturnsEmptyNamespace() { SerializationTestTypes.EmptyNsContainer instance = new SerializationTestTypes.EmptyNsContainer(new SerializationTestTypes.EmptyNSAddress()); @@ -2810,7 +2810,7 @@ public static void DCS_ResolveNameReturnsEmptyNamespace() Assert.True(result.address == null, "Address not null"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ResolveDatacontractBaseType() { SerializationTestTypes.Customer customerInstance = new SerializationTestTypes.PreferredCustomerProxy(); @@ -2852,7 +2852,7 @@ private static void DCS_BasicRoundTripResolvePrimitiveTypes(string baseline) /// Roundtrips a Datacontract type which contains Primitive types assigned to member of type object. /// Resolver is plugged in and resolves the primitive types. Verify resolver called during ser and deser /// - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundTripResolvePrimitiveTypes_NotNetFramework() { string baseline = @"<_data i:type=""a:PrimitiveContainer_foo"" xmlns:a=""http://www.default.com"">false25506553579228162514264337593543950335-19999-12-31T23:59:59.9999999-792281625142643375935439503354bc848b1-a541-40bf-8aa9-dd6ccb6d0e5610005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaN-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150AQIDBA==<_data2 i:type=""a:PrimitiveContainer_foo"" xmlns:a=""http://www.default.com"">false25506553579228162514264337593543950335-19999-12-31T23:59:59.9999999-792281625142643375935439503354bc848b1-a541-40bf-8aa9-dd6ccb6d0e5610005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaN-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150AQIDBA==
"; @@ -2864,7 +2864,7 @@ public static void DCS_BasicRoundTripResolvePrimitiveTypes_NotNetFramework() /// Some enums are resolved by Resolver and others by the KT attribute. /// Enum and struct members are of base enum type and ValueTyperespecitively /// - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundTripResolveEnumStructTypes() { var dataContractSerializerSettings = new DataContractSerializerSettings() @@ -2883,7 +2883,7 @@ public static void DCS_BasicRoundTripResolveEnumStructTypes() SerializationTestTypes.ComparisonHelper.CompareRecursively(value, actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRVariation1() { SerializationTestTypes.DCRVariations dcrVariationsGoing = new SerializationTestTypes.DCRVariations(); @@ -2911,7 +2911,7 @@ public static void DCS_BasicRoundtripDCRVariation1() SerializationTestTypes.ComparisonHelper.CompareRecursively(dcrVariationsGoing, dcrVariationsReturning); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRVariation2() { SerializationTestTypes.DCRVariations dcrVariationsGoing = new SerializationTestTypes.DCRVariations(); @@ -2937,7 +2937,7 @@ public static void DCS_BasicRoundtripDCRVariation2() SerializationTestTypes.ComparisonHelper.CompareRecursively(dcrVariationsGoing, dcrVariationsReturning); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRVariation3() { SerializationTestTypes.DCRVariations dcrVariationsGoing = new SerializationTestTypes.DCRVariations(); @@ -2964,7 +2964,7 @@ public static void DCS_BasicRoundtripDCRVariation3() SerializationTestTypes.ComparisonHelper.CompareRecursively(dcrVariationsGoing, dcrVariationsReturning); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRVariation4() { SerializationTestTypes.DCRVariations dcrVariationsGoing = new SerializationTestTypes.DCRVariations(); @@ -3000,7 +3000,7 @@ private static void CompareBaseline(string baseline, MemoryStream ms) Environment.NewLine, result.ErrorMessage, baseline, actualOutput)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundTripPOCOWithIgnoreDM() { var dataContractSerializerSettings = new DataContractSerializerSettings() @@ -3021,7 +3021,7 @@ public static void DCS_BasicRoundTripPOCOWithIgnoreDM() SerializationTestTypes.ComparisonHelper.CompareRecursively(value, actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRVerifyWireformatScenarios() { var dataContractSerializerSettings = new DataContractSerializerSettings() @@ -3051,7 +3051,7 @@ public static void DCS_BasicRoundtripDCRVerifyWireformatScenarios() SerializationTestTypes.ComparisonHelper.CompareRecursively(value3, actual3); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ResolveNameVariationTest() { SerializationTestTypes.ObjectContainer instance = new SerializationTestTypes.ObjectContainer(new SerializationTestTypes.UserTypeContainer()); @@ -3065,7 +3065,7 @@ public static void DCS_ResolveNameVariationTest() SerializationTestTypes.ComparisonHelper.CompareRecursively(instance, result); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicRoundtripDCRDefaultCollections() { var defaultCollections = new SerializationTestTypes.DefaultCollections(); @@ -3080,7 +3080,7 @@ public static void DCS_BasicRoundtripDCRDefaultCollections() SerializationTestTypes.ComparisonHelper.CompareRecursively(defaultCollections, actual); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_IObjectRef() { @@ -3097,7 +3097,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_IObjectRef() TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.DCIObjRefReturnsPrivate(), @"<_data i:type=""a:SerializationTestTypes.DCIObjRefReturnsPrivate***"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.DCIObjRefReturnsPrivate***""><_data z:Id=""i1"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/"">7b4ac88f-972b-43e5-8f6a-5ae64480eaad<_data2 i:type=""a:SerializationTestTypes.DCIObjRefReturnsPrivate***"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.DCIObjRefReturnsPrivate***""><_data z:Ref=""i1"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/""/>"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_SampleTypes() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3422,7 +3422,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_SampleTypes() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_DataSet() { @@ -3465,7 +3465,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_DataSet() Assert.Equal(valueDataSetPrivate.dataTable.Rows[0][0], resultDataSetPrivate.dataTable.Rows[0][0]); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_TypeInheritedFromIListT() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3479,7 +3479,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_TypeInheritedFromIL TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.SampleListTExplicitWithCDCContainsPrivateDC(true), $@"<_data z:Id=""i1"" i:type=""a:SerializationTestTypes.SampleListTExplicitWithCDCContainsPrivateDC***"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.SampleListTExplicitWithCDCContainsPrivateDC***"">7b4ac88f-972b-43e5-8f6a-5ae64480eaad7b4ac88f-972b-43e5-8f6a-5ae64480eaad<_data2 z:Ref=""i1"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/""/>"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_InheritedFromIList() { TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.SampleListExplicitWithoutDC(true), @"<_data i:type=""a:SerializationTestTypes.SampleListExplicitWithoutDC***"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.SampleListExplicitWithoutDC***"">0001-01-01T00:00:00P10675199DT2H48M5.4775807S1.7976931348623157E+308-INF0c9e174e-cdd8-4b68-a70d-aaeb26c7deeb<_data2 i:type=""a:SerializationTestTypes.SampleListExplicitWithoutDC***"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.SampleListExplicitWithoutDC***"">0001-01-01T00:00:00P10675199DT2H48M5.4775807S1.7976931348623157E+308-INF0c9e174e-cdd8-4b68-a70d-aaeb26c7deeb"); @@ -3493,7 +3493,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_InheritedFromIList( TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.SampleListExplicitWithCDCContainsPrivateDC(true), @"<_data z:Id=""i1"" i:type=""a:SerializationTestTypes.SampleListExplicitWithCDCContainsPrivateDC***"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/"" xmlns:a=""http://schemas.datacontract.org/2004/07/SerializationTestTypes.SampleListExplicitWithCDCContainsPrivateDC***"">0001-01-01T00:00:00P10675199DT2H48M5.4775807S1.7976931348623157E+308-INF0c9e174e-cdd8-4b68-a70d-aaeb26c7deeb7b4ac88f-972b-43e5-8f6a-5ae64480eaad<_data2 z:Ref=""i1"" xmlns:z=""http://schemas.microsoft.com/2003/10/Serialization/""/>"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_SampleTypes_SampleICollectionTExplicit() { var setting = new DataContractSerializerSettings() @@ -3518,7 +3518,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_SampleTypes_SampleI TestObjectWithDifferentPayload(valueSampleICollectionTExplicitWithCDCContainsPrivateDC, netcorePayloadSampleICollectionTExplicitWithCDCContainsPrivateDC, desktopPayloadSampleICollectionTExplicitWithCDCContainsPrivateDC, setting); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_Collections() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3537,7 +3537,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_Collections() TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.DMWithRefInCollection1(true), "<_data z:Id=\"i1\" i:type=\"a:SerializationTestTypes.DMWithRefInCollection1***\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.DMWithRefInCollection1***\">This is a stringThis is a stringa6d053ed-f7d4-42fb-8e56-e4b425f26fa9a6d053ed-f7d4-42fb-8e56-e4b425f26fa9This is a string<_data2 z:Ref=\"i1\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\"/>"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_CollectionDataContract() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3552,7 +3552,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_CollectionDataContr TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.DMWithRefInDict1(true), $"<_data z:Id=\"i1\" i:type=\"a:SerializationTestTypes.DMWithRefInDict1***\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.DMWithRefInDict1***\">This is a stringThis is a stringThis is a string6d807157-536f-4794-a157-e463a11029aaThis is a stringThis is a string6d807157-536f-4794-a157-e463a11029aa<_data2 z:Ref=\"i1\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\"/>"); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_ItRef() { TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.TestInheritence9(true), "<_data i:type=\"a:SerializationTestTypes.TestInheritence9***\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.TestInheritence9***\">TestStringTestString2TestString0TestString1TestString3TestString00TestString122TestString4TestStringTestString2Base1Base2Base3Base4Base5Base6Base7TestString0TestString1TestString3TestStringTestString2TestString0TestString1TestString3TestString00TestString122TestString4TestStringTestString2Base1Base2Base3Base4Base5Base6Base7TestString0TestString1TestString3<_data2 i:type=\"a:SerializationTestTypes.TestInheritence9***\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.TestInheritence9***\">TestStringTestString2TestString0TestString1TestString3TestString00TestString122TestString4TestStringTestString2Base1Base2Base3Base4Base5Base6Base7TestString0TestString1TestString3TestStringTestString2TestString0TestString1TestString3TestString00TestString122TestString4TestStringTestString2Base1Base2Base3Base4Base5Base6Base7TestString0TestString1TestString3"); @@ -3685,7 +3685,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_ItRef() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_SelfRefCycles() { TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.SelfRef1(true), "<_data z:Id=\"i1\" i:type=\"a:SerializationTestTypes.SelfRef1***\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.SelfRef1***\"><_data2 z:Ref=\"i1\" xmlns:z=\"http://schemas.microsoft.com/2003/10/Serialization/\"/>"); @@ -3738,7 +3738,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_SelfRefCycles() } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct() { string assemblyName = typeof(DataContractSerializerTests).Assembly.FullName; @@ -3821,7 +3821,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct_NotNetFramework() { TestObjectInObjectContainerWithSimpleResolver(new SerializationTestTypes.AllTypes(), "<_data i:type=\"a:SerializationTestTypes.AllTypes***\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.AllTypes***\">false25506553579228162514264337593543950335redred-10001-01-01T00:00:00-792281625142643375935439503355642b5d2-87c3-a724-2390-997062f3f7a210005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaNData-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150<_data2 i:type=\"a:SerializationTestTypes.AllTypes***\" xmlns:a=\"http://schemas.datacontract.org/2004/07/SerializationTestTypes.AllTypes***\">false25506553579228162514264337593543950335redred-10001-01-01T00:00:00-792281625142643375935439503355642b5d2-87c3-a724-2390-997062f3f7a210005E-3241.7976931348623157E+308-1.7976931348623157E+3089999-12-31T23:59:59.9999999Z0NaN

-INF

INF01E-45-3.4028235E+38P10675199DT2H48M5.4775807S3.4028235E+38http://www.microsoft.com/NaNData-INFINFb:WCF02147483647-214748364809223372036854775807-92233720368547758080127-128032767-32768abc06553500429496729500184467440737095516150
"); @@ -3832,7 +3832,7 @@ public static void DCS_BasicPerSerializerRoundTripAndCompare_EnumStruct_NotNetFr #endregion - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithVirtualGenericProperty() { var value1 = new TypeWithVirtualGenericProperty() { Value = 1 }; @@ -3846,7 +3846,7 @@ public static void DCS_TypeWithVirtualGenericProperty() Assert.Equal(value2.Value, actual2.Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MyPersonSurrogate() { DataContractSerializer dcs = new DataContractSerializer(typeof(Family)); @@ -3871,7 +3871,7 @@ public static void DCS_MyPersonSurrogate() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_FileStreamSurrogate() { using (var testFile = TempFile.Create()) @@ -3908,7 +3908,7 @@ public static void DCS_FileStreamSurrogate() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_KnownTypeMethodName() { var emp1 = new EmployeeC("Steve"); @@ -3928,7 +3928,7 @@ public static void DCS_KnownTypeMethodName() Assert.Equal(value.emps[1].Name, actual.emps[1].Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_SampleICollectionTExplicitWithoutDC() { var value = new SerializationTestTypes.SampleICollectionTExplicitWithoutDC(true); @@ -3937,7 +3937,7 @@ public static void DCS_SampleICollectionTExplicitWithoutDC() TestObjectWithDifferentPayload(value, netcorePayload, desktopPayload); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MemoryStream_Serialize_UsesBuiltInAdapter() { ValidateObject( @@ -3995,7 +3995,7 @@ static void ValidateObject(MemoryStream original, string expectedXml, byte[] exp } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_MemoryStream_Deserialize_CompatibleWithFullFramework() { // The payloads in this test were generated by a Full Framework application. @@ -4135,7 +4135,7 @@ public static void DCS_InvalidDataContract_Read_Invalid_Types_Throws() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ValidateExceptionOnUnspecifiedRootSerializationType() { var value = new UnspecifiedRootSerializationType(); @@ -4146,7 +4146,7 @@ public static void DCS_ValidateExceptionOnUnspecifiedRootSerializationType() Assert.Equal(value.MyStringProperty, actual.MyStringProperty); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithCollectionAndDateTimeOffset() { // Adding offsetMinutes so the DateTime component in serialized strings are time-zone independent @@ -4161,7 +4161,7 @@ public static void DCS_TypeWithCollectionAndDateTimeOffset() Assert.True(Enumerable.SequenceEqual(value.AnIntList, actual.AnIntList)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithCollectionAndDateTimeOffset_ListIsNull() { // Adding offsetMinutes so the DateTime component in serialized strings are time-zone independent @@ -4176,7 +4176,7 @@ public static void DCS_TypeWithCollectionAndDateTimeOffset_ListIsNull() Assert.Equal(0, actual.AnIntList.Count); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_TypeWithPrimitiveKnownTypes() { var list = new TypeWithPrimitiveKnownTypes(); @@ -4217,7 +4217,7 @@ public static void DCS_TypeWithPrimitiveKnownTypes() } [ActiveIssue("https://github.com/dotnet/runtime/issues/1417", TestPlatforms.OSX)] - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_DeeplyLinkedData() { TypeWithLinkedProperty head = new TypeWithLinkedProperty(); @@ -4240,7 +4240,7 @@ public static void DCS_DifferentCollectionsOfSameTypeAsKnownTypes() }); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void DCS_ReadObject_XmlDictionaryReaderMaxStringContentLengthExceedsQuota() { DataContractSerializer dcs = new DataContractSerializer(typeof(TypeA)); diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs index 719a06d6e48cf9..965a9d7b36b746 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs @@ -279,7 +279,7 @@ public static void StreamProvoiderTest() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void IXmlBinaryReaderWriterInitializerTest() { DataContractSerializer serializer = new DataContractSerializer(typeof(TestData)); From 4f498b797899dcf62283f7d3c20a2ee549b563f7 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Mon, 31 May 2021 10:47:42 +0300 Subject: [PATCH 23/51] More skipped library tests --- .../tests/PartBuilderInterfaceTests.cs | 2 +- .../Marshal/GetDelegateForFunctionPointerTests.cs | 2 +- .../Runtime/InteropServices/Marshal/PtrToStructureTests.cs | 2 +- .../tests/XmlSerializerTests.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs b/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs index 3aca86b1aefe80..da4b236ef01141 100644 --- a/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs +++ b/src/libraries/System.Composition.Convention/tests/PartBuilderInterfaceTests.cs @@ -59,7 +59,7 @@ public class Importer public BareClass BareClass { get; set; } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StandardExportInterfacesShouldWork() { // Export all interfaces except IDisposable, Export contracts on types without interfaces. except for disposable types diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs index 1747260a3d1865..0c558ce5ccc273 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/GetDelegateForFunctionPointerTests.cs @@ -28,7 +28,7 @@ public void GetDelegateForFunctionPointer_NonGeneric_ReturnsExpected(Type t) VerifyDelegate(functionDelegate, targetMethod); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDelegateForFunctionPointer_CollectibleType_ReturnsExpected() { MethodInfo targetMethod = typeof(GetDelegateForFunctionPointerTests).GetMethod(nameof(Method), BindingFlags.NonPublic | BindingFlags.Static); diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs index 8736da98047d8a..5531409b892f4c 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/PtrToStructureTests.cs @@ -12,7 +12,7 @@ namespace System.Runtime.InteropServices.Tests { public class PtrToStructureTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void StructureToPtr_NonGenericType_ReturnsExpected() { var structure = new SequentialClass diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlSerializerTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlSerializerTests.cs index 089e45de113109..7668b9e52c5a86 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlSerializerTests.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlSerializerTests.cs @@ -12,7 +12,7 @@ public static class XmlSerializerTests public const string FakeNS = "http://example.com/XmlSerializerTests"; - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static void FlagEnums_With_Different_Namespaces() { StringWriter sw = new StringWriter(); From ff94a363140a71cc6772692459172167d2612e07 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Tue, 1 Jun 2021 11:55:58 +0300 Subject: [PATCH 24/51] Skip more tests --- .../VisualBasic/FileIO/FileSystemTests.cs | 2 +- .../tests/ImmutableListTest.cs | 2 +- .../tests/PropertyTests/CborPropertyTests.cs | 5 +++++ .../Syndication/Atom10FeedFormatterTests.cs | 4 ++-- .../Syndication/Atom10ItemFormatterTests.cs | 4 ++-- ...omPub10CategoriesDocumentFormatterTests.cs | 6 +++--- .../AtomPub10ServiceDocumentFormatterTests.cs | 4 ++-- .../InlineCategoriesDocumentTests.cs | 2 +- .../ReferencedCategoriesDocumentTests.cs | 2 +- .../ResourceCollectionInfoTests.cs | 2 +- .../Syndication/Rss20ItemFormatterTests.cs | 4 ++-- .../ServiceDocumentFormatterTests.cs | 16 +++++++-------- .../Syndication/ServiceDocumentTests.cs | 2 +- .../Syndication/SyndicationCategoryTests.cs | 2 +- .../Syndication/SyndicationContentTests.cs | 4 ++-- ...dicationElementExtensionCollectionTests.cs | 2 +- .../SyndicationElementExtensionTests.cs | 14 ++++++------- .../SyndicationFeedFormatterTests.cs | 20 +++++++++---------- .../Syndication/SyndicationFeedTests.cs | 2 +- .../SyndicationItemFormatterTests.cs | 16 +++++++-------- .../Syndication/SyndicationItemTests.cs | 2 +- .../Syndication/SyndicationLinkTests.cs | 2 +- .../Syndication/SyndicationPersonTests.cs | 2 +- .../Syndication/WorkspaceTests.cs | 2 +- .../Syndication/XmlSyndicationContentTests.cs | 12 +++++------ .../tests/ValueTaskTests.cs | 2 ++ 26 files changed, 72 insertions(+), 65 deletions(-) diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs index a2f8632f98f395..0c235e5c883605 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/Microsoft/VisualBasic/FileIO/FileSystemTests.cs @@ -483,7 +483,7 @@ public void GetDirectoryInfo_Directory() Assert.Equal(info.Root.Name, infoFromIO.Root.Name); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetDriveInfo_Drive() { var Drives = System.IO.DriveInfo.GetDrives(); diff --git a/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs b/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs index ce3be6dd778f0e..31aed29b3e1e9d 100644 --- a/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs +++ b/src/libraries/System.Collections.Immutable/tests/ImmutableListTest.cs @@ -793,7 +793,7 @@ public static void TestDebuggerAttributes_Null() } #if NETCOREAPP - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void UsableWithCollectibleAssemblies() { var assembly = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName("dynamic_assembly"), AssemblyBuilderAccess.RunAndCollect); diff --git a/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs b/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs index d265baec831d56..db55cab9f27c1a 100644 --- a/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs +++ b/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs @@ -9,6 +9,11 @@ namespace System.Formats.Cbor.Tests { + // TODO Find out the way to skip individual tests failing with "Attempting to JIT compile method ... while running in aot-only mode.": + // - CborDocument_SkipValue + // - CborDocument_SkipToParent + // - CborDocument_Roundtrip + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static class CborPropertyTests { private const string? ReplaySeed = "(42,42)"; // set a seed for deterministic runs, null for randomized runs diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10FeedFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10FeedFormatterTests.cs index 1899ad8f636279..45abe444da96f7 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10FeedFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10FeedFormatterTests.cs @@ -383,7 +383,7 @@ SyndicationLink CreateLink(string prefix) }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(WriteTo_TestData))] public void Write_HasFeed_SerializesExpected(SyndicationFeed feed, string expected) { @@ -619,7 +619,7 @@ public void CanRead_NullReader_ThrowsArgumentNullException() AssertExtensions.Throws("reader", () => formatter.CanRead(null)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true, true)] [InlineData(false, false)] public void Read_FullItem_ReturnsExpected(bool preserveAttributeExtensions, bool preserveElementExtensions) diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10ItemFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10ItemFormatterTests.cs index 8ef2f8decda9fd..767cc2285615a7 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10ItemFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Atom10ItemFormatterTests.cs @@ -281,7 +281,7 @@ TextSyndicationContent CreateContent(string prefix) }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(WriteTo_TestData))] public void WriteTo_HasItem_SerializesExpected(SyndicationItem item, string expected) { @@ -402,7 +402,7 @@ public void CanRead_NullReader_ThrowsArgumentNullException() AssertExtensions.Throws("reader", () => formatter.CanRead(null)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true, true)] [InlineData(false, false)] public void Read_FullItem_ReturnsExpected(bool preserveAttributeExtensions, bool preserveElementExtensions) diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatterTests.cs index db1f33bb5d3f7f..f666ee72ba0c9c 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10CategoriesDocumentFormatterTests.cs @@ -168,7 +168,7 @@ public static IEnumerable WriteTo_TestData() }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(WriteTo_TestData))] public void WriteTo_HasDocument_SerializesExpected(CategoriesDocument document, string expected) { @@ -245,7 +245,7 @@ public void CanRead_NullReader_ThrowsArgumentNullException() AssertExtensions.Throws("reader", () => formatter.CanRead(null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadFrom_InlineCategoriesDocument_ReturnsExpected() { string xmlString = @@ -341,7 +341,7 @@ public void Read_InlineCategoriesDocumentTryParseTrue_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadFrom_ReferencedCategoriesDocument_ReturnsExpected() { string xmlString = diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatterTests.cs index 55fca752091a26..e34a7ef3a55ab0 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/AtomPub10ServiceDocumentFormatterTests.cs @@ -241,7 +241,7 @@ public static IEnumerable WriteTo_TestData() }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(WriteTo_TestData))] public void WriteTo_HasDocument_SerializesExpected(ServiceDocument document, string expected) { @@ -328,7 +328,7 @@ public void CanRead_NullReader_ThrowsArgumentNullException() AssertExtensions.Throws("reader", () => formatter.CanRead(null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadFrom_FullDocument_ReturnsExpected() { string xmlString = @" diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/InlineCategoriesDocumentTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/InlineCategoriesDocumentTests.cs index 071a74d94a5254..a772abdfa8d4ec 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/InlineCategoriesDocumentTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/InlineCategoriesDocumentTests.cs @@ -174,7 +174,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => document.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ReferencedCategoriesDocumentTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ReferencedCategoriesDocumentTests.cs index a06d9bee7216d0..a61b356d2b4b17 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ReferencedCategoriesDocumentTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ReferencedCategoriesDocumentTests.cs @@ -167,7 +167,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => document.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ResourceCollectionInfoTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ResourceCollectionInfoTests.cs index b301dadedabd05..6f0c9514bad50b 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ResourceCollectionInfoTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ResourceCollectionInfoTests.cs @@ -291,7 +291,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => collectionInfo.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Rss20ItemFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Rss20ItemFormatterTests.cs index ea5952745aca8c..a86f7fea06daf9 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Rss20ItemFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/Rss20ItemFormatterTests.cs @@ -537,7 +537,7 @@ TextSyndicationContent CreateContent(string prefix) }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(WriteTo_TestData))] public void WriteTo_Invoke_SerializesExpected(SyndicationItem item, bool serializeExtensionsAsAtom, string expected) { @@ -631,7 +631,7 @@ public void CanRead_NullReader_ThrowsArgumentNullException() AssertExtensions.Throws("reader", () => formatter.CanRead(null)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true, true)] [InlineData(false, false)] public void ReadFrom_FullItem_ReturnsExpected(bool preserveAttributeExtensions, bool preserveElementExtensions) diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentFormatterTests.cs index 5464381762e9c7..0d64a7c66c1c05 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentFormatterTests.cs @@ -142,7 +142,7 @@ public void CreateWorkspace_NullDocument_ThrowsArgumentNullException() AssertExtensions.Throws("document", () => Formatter.CreateWorkspaceEntryPoint(null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Categories_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -169,7 +169,7 @@ public void LoadElementExtensions_NullCategories_ThrowsArgumentNullException() AssertExtensions.Throws("categories", () => Formatter.LoadElementExtensionsEntryPoint(reader, (CategoriesDocument)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Collection_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -196,7 +196,7 @@ public void LoadElementExtensions_NullCollection_ThrowsArgumentNullException() AssertExtensions.Throws("collection", () => Formatter.LoadElementExtensionsEntryPoint(reader, (ResourceCollectionInfo)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Workspace_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -223,7 +223,7 @@ public void LoadElementExtensions_NullWorkspace_ThrowsArgumentNullException() AssertExtensions.Throws("workspace", () => Formatter.LoadElementExtensionsEntryPoint(reader, (Workspace)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_ServiceDocument_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -412,7 +412,7 @@ public static IEnumerable Version_TestData() yield return new object[] { "version" }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Categories_Success(string version) { @@ -440,7 +440,7 @@ public void WriteElementExtensions_NullCategories_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Collection_Success(string version) { @@ -468,7 +468,7 @@ public void WriteElementExtensions_NullCollection_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Workspace_Success(string version) { @@ -496,7 +496,7 @@ public void WriteElementExtensions_NullWorkspace_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_ServiceDocument_Success(string version) { diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentTests.cs index bc39ffaba44a63..578ca06d3329f1 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/ServiceDocumentTests.cs @@ -145,7 +145,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => document.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationCategoryTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationCategoryTests.cs index a7ca29f8b99e62..b05594cbc3f9d0 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationCategoryTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationCategoryTests.cs @@ -173,7 +173,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => category.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationContentTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationContentTests.cs index 9b07ba9340e6b2..fdefe5cf198c82 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationContentTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationContentTests.cs @@ -158,7 +158,7 @@ public void CreateUrlContent_NullUrl_ThrowsArgumentNullException() AssertExtensions.Throws("url", () => SyndicationContent.CreateUrlContent(null, "mediaType")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateXmlContent_Reader_NoAttributes() { XmlSyndicationContent content = SyndicationContent.CreateXmlContent( @@ -178,7 +178,7 @@ public void CreateXmlContent_Reader_NoAttributes() Assert.Equal(10, content.ReadContent((XmlSerializer)null).Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CreateXmlContent_Reader_Attributes() { XmlSyndicationContent content = SyndicationContent.CreateXmlContent( diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionCollectionTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionCollectionTests.cs index a8b352822cfc7a..2760de324a8a50 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionCollectionTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionCollectionTests.cs @@ -13,7 +13,7 @@ namespace System.ServiceModel.Syndication.Tests { public class SyndicationElementExtensionCollectionTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Add_Invoke_ReturnsExpected() { SyndicationElementExtensionCollection elementExtensions = new SyndicationCategory().ElementExtensions; diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionTests.cs index e7d57bb2c2d214..7cab5d05ba2e83 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationElementExtensionTests.cs @@ -14,7 +14,7 @@ namespace System.ServiceModel.Syndication.Tests { public class ServiceElementExtensionTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Ctor_Reader() { var extension = new SyndicationElementExtension(new XElement("ExtensionObject", new XElement("Value", 10)).CreateReader()); @@ -25,7 +25,7 @@ public void Ctor_Reader() Assert.Equal(10, extension.GetObject(new XmlSerializer(typeof(ExtensionObject))).Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Ctor_ReaderNotAtStart_ReturnsExpected() { using (XmlReader reader = new XElement("parent", new XElement("ExtensionObject", new XElement("Value", 10))).CreateReader()) @@ -219,7 +219,7 @@ public void GetReader_WithReader_ReturnsExpected() Assert.Equal(@"10", reader.ReadOuterXml()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetReader_ObjectWithXmlObjectSerializer_ReturnsExpected() { var extensionObject = new ExtensionObject() { Value = 10 }; @@ -228,7 +228,7 @@ public void GetReader_ObjectWithXmlObjectSerializer_ReturnsExpected() Assert.Equal(@"10", reader.ReadOuterXml()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void GetReader_ObjectWithXmlSerializer_ReturnsExpected() { @@ -268,7 +268,7 @@ public void WriteTo_WithReader_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WriteTo_ObjectWithXmlObjectSerializer_ReturnsExpected() { var extensionObject = new ExtensionObject { Value = 10 }; @@ -285,7 +285,7 @@ public void WriteTo_ObjectWithXmlObjectSerializer_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void WriteTo_ObjectWithXmlSerializer_ReturnsExpected() { @@ -320,7 +320,7 @@ public void ISerializableIsAny_XmlObjectSerializer_OuterNameReturnsExpected() Assert.NotNull(extension.GetObject(new DataContractSerializer(typeof(XmlSerializabWithIsAnyNull)))); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ISerializableIsAny_XmlSerializer_OuterNameReturnsExpected() { var extensionObject = new XmlSerializabWithIsAny(); diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedFormatterTests.cs index 5a5d6b3d2f0139..74cdb73608d0c7 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedFormatterTests.cs @@ -224,7 +224,7 @@ public void CreatePerson_FeedReturnsNull_ThrowsInvalidOperationException() Assert.Throws(() => Formatter.CreatePersonEntryPoint(feed)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Categories_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -251,7 +251,7 @@ public void LoadElementExtensions_NullCategories_ThrowsArgumentNullException() AssertExtensions.Throws("category", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationCategory)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Feed_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -278,7 +278,7 @@ public void LoadElementExtensions_NullFeed_ThrowsArgumentNullException() AssertExtensions.Throws("feed", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationFeed)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Item_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -305,7 +305,7 @@ public void LoadElementExtensions_NullItem_ThrowsArgumentNullException() AssertExtensions.Throws("item", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationItem)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Link_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -332,7 +332,7 @@ public void LoadElementExtensions_NullLink_ThrowsArgumentNullException() AssertExtensions.Throws("link", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationLink)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Person_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -692,7 +692,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => Formatter.WriteAttributeExtensionsEntryPoint(null, new SyndicationPerson(), "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Category_Success(string version) { @@ -722,7 +722,7 @@ public void WriteElementExtensions_NullCategory_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Item_Success(string version) { @@ -750,7 +750,7 @@ public void WriteElementExtensions_NullFeed_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Feed_Success(string version) { @@ -778,7 +778,7 @@ public void WriteElementExtensions_NullItem_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Link_Success(string version) { @@ -808,7 +808,7 @@ public void WriteElementExtensions_NullLink_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Person_Success(string version) { diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedTests.cs index 280929d010f955..ed1d743ba60694 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationFeedTests.cs @@ -356,7 +356,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => feed.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemFormatterTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemFormatterTests.cs index 4c1cd210c654bd..bac020e4a26744 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemFormatterTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemFormatterTests.cs @@ -111,7 +111,7 @@ public void CreatePerson_ItemReturnsNull_ThrowsInvalidOperationException() Assert.Throws(() => Formatter.CreatePersonEntryPoint(item)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Categories_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -138,7 +138,7 @@ public void LoadElementExtensions_NullCategories_ThrowsArgumentNullException() AssertExtensions.Throws("category", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationCategory)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Item_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -165,7 +165,7 @@ public void LoadElementExtensions_NullItem_ThrowsArgumentNullException() AssertExtensions.Throws("item", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationItem)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Link_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -192,7 +192,7 @@ public void LoadElementExtensions_NullLink_ThrowsArgumentNullException() AssertExtensions.Throws("link", () => Formatter.LoadElementExtensionsEntryPoint(reader, (SyndicationLink)null, int.MaxValue)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void LoadElementExtensions_Person_Success() { var settings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment }; @@ -500,7 +500,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => Formatter.WriteAttributeExtensionsEntryPoint(null, new SyndicationPerson(), "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Category_Success(string version) { @@ -530,7 +530,7 @@ public void WriteElementExtensions_NullCategory_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Item_Success(string version) { @@ -558,7 +558,7 @@ public void WriteElementExtensions_NullItem_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Link_Success(string version) { @@ -588,7 +588,7 @@ public void WriteElementExtensions_NullLink_ThrowsArgumentNullException() } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(Version_TestData))] public void WriteElementExtensions_Person_Success(string version) { diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemTests.cs index e5f8f7842d8bde..b8418a06e94803 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationItemTests.cs @@ -565,7 +565,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => item.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationLinkTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationLinkTests.cs index 6ed01307e0cfa4..b4bcb5c825378c 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationLinkTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationLinkTests.cs @@ -362,7 +362,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => link.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationPersonTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationPersonTests.cs index 0e1f1c84091f62..e9b25a2678064b 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationPersonTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/SyndicationPersonTests.cs @@ -173,7 +173,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => person.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/WorkspaceTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/WorkspaceTests.cs index 78e30ffea3b39a..1e4c4c53fc6f49 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/WorkspaceTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/WorkspaceTests.cs @@ -177,7 +177,7 @@ public void WriteAttributeExtensions_NullWriter_ThrowsArgumentNullException() AssertExtensions.Throws("writer", () => workspace.WriteAttributeExtensionsEntryPoint(null, "version")); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(null)] [InlineData("")] [InlineData("version")] diff --git a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/XmlSyndicationContentTests.cs b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/XmlSyndicationContentTests.cs index 72653c47447200..8c1d6fa26e5eaa 100644 --- a/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/XmlSyndicationContentTests.cs +++ b/src/libraries/System.ServiceModel.Syndication/tests/System/ServiceModel/Syndication/XmlSyndicationContentTests.cs @@ -13,7 +13,7 @@ namespace System.ServiceModel.Syndication.Tests { public class XmlSyndicationContentTests { - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Ctor_Reader_NoAttributes() { var content = new XmlSyndicationContent( @@ -33,7 +33,7 @@ public void Ctor_Reader_NoAttributes() Assert.Equal(10, content.ReadContent((XmlSerializer)null).Value); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Ctor_Reader_Attributes() { var content = new XmlSyndicationContent( @@ -219,7 +219,7 @@ public void WriteTo_WithEmptyReader_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WriteTo_ObjectWithXmlObjectSerializer_ReturnsExpected() { var extensionObject = new ExtensionObject() { Value = 10 }; @@ -232,7 +232,7 @@ public void WriteTo_ObjectWithXmlObjectSerializer_ReturnsExpected() ", writer => content.WriteTo(writer, "OuterElementName", "OuterElementNamespace")); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void WriteTo_ObjectWithXmlSerializer_ReturnsExpected() { @@ -268,7 +268,7 @@ public void GetReaderAtContent_WithReader_ReturnsExpected() CompareHelper.AssertEqualLongString(@"10", reader.ReadOuterXml()); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void GetReaderAtContent_ObjectWithXmlObjectSerializer_ReturnsExpected() { var extensionObject = new ExtensionObject() { Value = 10 }; @@ -279,7 +279,7 @@ public void GetReaderAtContent_ObjectWithXmlObjectSerializer_ReturnsExpected() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework)] public void GetReaderAtContent_ObjectWithXmlSerializer_ReturnsExpected() { diff --git a/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs b/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs index d93053de7d1472..003e6eedb28c6e 100644 --- a/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs +++ b/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs @@ -1168,6 +1168,7 @@ public void Generic_ToString_Success() [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAndroid))] [InlineData(typeof(ValueTask))] public void NonGeneric_AsyncMethodBuilderAttribute_ValueTaskAttributed(Type valueTaskType) { @@ -1181,6 +1182,7 @@ public void NonGeneric_AsyncMethodBuilderAttribute_ValueTaskAttributed(Type valu [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAndroid))] [InlineData(typeof(ValueTask<>))] [InlineData(typeof(ValueTask))] [InlineData(typeof(ValueTask))] From 386d3651c8490fbb5e1fb58c7a6befdf5ee01b69 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Tue, 1 Jun 2021 15:45:57 +0300 Subject: [PATCH 25/51] Skip more tests --- .../TestUtilities/System/PlatformDetection.cs | 3 ++- .../tests/QueryOperators/JoinTests.cs | 2 +- .../System.Linq/tests/OrderByTests.cs | 2 +- .../tests/Metadata/TagToTokenTests.cs | 2 +- .../PathAssemblyResolver.cs | 1 + .../IDispatchImplAttributeTests.cs | 2 +- ...etWin32ContextInIDispatchAttributeTests.cs | 2 +- .../tests/Encoding/TranscodingStreamTests.cs | 22 +++++++++---------- src/libraries/tests.proj | 7 ++++++ 9 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index bf76633031014c..8c301165875f65 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -29,7 +29,8 @@ public static partial class PlatformDetection public static bool IsNetBSD => RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")); public static bool IsAndroid => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID")); public static bool IsiOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")); - public static bool IsNotAndroidAOT => !(IsAndroid && IsMonoAOT); + public static bool IsAndroidAOT => IsAndroid && IsMonoAOT; + public static bool IsNotAndroidAOT => !IsAndroidAOT; public static bool IsNotDeviceAOT => !((IsAndroid || IsiOS) && IsMonoAOT); public static bool IstvOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")); public static bool IsMacCatalyst => RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST")); diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs index 31f55759e4f8c2..3da256880e8a03 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs @@ -203,7 +203,7 @@ protected override int GetExpectedSeenLeftCount(int leftCount, int rightCount) } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(JoinMultipleData), new[] { 2, KeyFactor - 1, KeyFactor, KeyFactor + 1, KeyFactor * 2 - 1, KeyFactor * 2, KeyFactor * 2 + 1 })] public static void Join_Multiple_LeftWithOrderingColisions(Labeled> left, int leftCount, Labeled> right, int rightCount) { diff --git a/src/libraries/System.Linq/tests/OrderByTests.cs b/src/libraries/System.Linq/tests/OrderByTests.cs index 095e5cc81ebdee..9c5dc16d981d97 100644 --- a/src/libraries/System.Linq/tests/OrderByTests.cs +++ b/src/libraries/System.Linq/tests/OrderByTests.cs @@ -428,7 +428,7 @@ public void OrderByIsCovariantTestWithAssignToArgument() Assert.Equal(expected, covariantOrdered); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void CanObtainFromCovariantIOrderedQueryable() { // If an ordered queryable is cast covariantly and then has ThenBy() called on it, diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs index 19e7babec58b7c..942efd8d10d784 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/TagToTokenTests.cs @@ -95,7 +95,7 @@ private IEnumerable GetTags() [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAndroid))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public void ValidateTagToTokenConversion() { foreach (var tag in GetTags()) diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs index 464a925598097c..a9689d049dc80d 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs @@ -324,6 +324,7 @@ public static void DuplicateSignedAndUnsignedAssemblies() } [Fact] + [ActiveIssue("System.IO.FileNotFoundException", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public static void RelocatableAssembly() { string coreAssemblyPath = TestUtils.GetPathToCoreAssembly(); diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs index e2378509c3f8c2..07d4e850dfa55a 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/IDispatchImplAttributeTests.cs @@ -13,7 +13,7 @@ public class IDispatchImplAttributeTests [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/50717", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50717", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAndroid))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50717", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [InlineData(-1)] [InlineData(0)] [InlineData(2)] diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs index 9cdd16891fb8fa..c2a7807f9f145f 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/SetWin32ContextInIDispatchAttributeTests.cs @@ -12,7 +12,7 @@ public class SetWin32ContextInIDispatchAttributeTests [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAndroid))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50714", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public void Ctor_Default_ExistsInSrc() { Type type = typeof(HandleCollector).Assembly.GetType(TypeName); diff --git a/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs b/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs index ffb9f86903c574..ff40b1752ede91 100644 --- a/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs +++ b/src/libraries/System.Text.Encoding/tests/Encoding/TranscodingStreamTests.cs @@ -39,7 +39,7 @@ public static IEnumerable ReadWriteTestBufferLengths } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void AsyncMethods_ReturnCanceledTaskIfCancellationTokenTripped() { // Arrange @@ -77,7 +77,7 @@ public void CreateTranscodingStream_InvalidArgs() Assert.Throws("outerStreamEncoding", () => Encoding.CreateTranscodingStream(Stream.Null, Encoding.UTF8, null)); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true)] [InlineData(false)] public void CanRead_DelegatesToInnerStream(bool expectedCanRead) @@ -100,7 +100,7 @@ public void CanRead_DelegatesToInnerStream(bool expectedCanRead) Assert.False(actualCanReadAfterDispose); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [InlineData(true)] [InlineData(false)] public void CanWrite_DelegatesToInnerStream(bool expectedCanWrite) @@ -198,7 +198,7 @@ public void Dispose_WithLeaveOpenTrue_DoesNotDisposeInnerStream() innerStream.Read(Span.Empty); // shouldn't throw } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void Flush_FlushesInnerStreamButNotDecodedState() { // Arrange @@ -391,7 +391,7 @@ void RunOneTestIteration(int stringLength) } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public Task ReadApm() { // Tests TranscodingStream.BeginRead / EndRead @@ -432,7 +432,7 @@ public Task ReadApm() suppressExpectedCancellationTokenAsserts: true); // APM pattern doesn't allow flowing CancellationToken } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadWriteTestBufferLengths))] public Task ReadAsync_ByteArray(int bufferLength) { @@ -451,7 +451,7 @@ public Task ReadAsync_ByteArray(int bufferLength) }); } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(ReadWriteTestBufferLengths))] public async Task ReadAsync_Memory(int bufferLength) { @@ -631,7 +631,7 @@ async Task RunOneTestIteration(int stringLength) } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void ReadTimeout_WriteTimeout_NotSupported() { // Arrange - allow inner stream to support ReadTimeout + WriteTimeout @@ -765,7 +765,7 @@ public void Write_WithInvalidArgs_Throws() Assert.Throws(() => transcodingStream.Write(new byte[5], 6, 0)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task WriteAsync_WithFullData() { MemoryStream sink = new MemoryStream(); @@ -824,7 +824,7 @@ public async Task WriteAsync_WithFullData() Assert.Equal(0, sink.Position); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public async Task WriteAsync_WithPartialData() { MemoryStream sink = new MemoryStream(); @@ -879,7 +879,7 @@ public void WriteAsync_WithInvalidArgs_Throws() Assert.Throws(() => (object)transcodingStream.WriteAsync(new byte[5], 6, 0)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public void WriteApm() { // Arrange diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index ef5b398bc727e4..1aacf80b0d923e 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -223,6 +223,13 @@ + + + + + + + From 1ac9b885efb7f4f759ad0da88e982a4ecb89e8e1 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Wed, 2 Jun 2021 12:06:33 +0300 Subject: [PATCH 26/51] Skip more tests --- .../Microsoft.VisualBasic.Core/tests/ConversionTests.cs | 1 + src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs | 1 + .../System.Linq.Parallel/tests/QueryOperators/JoinTests.cs | 2 +- .../System.Runtime.Extensions/tests/System/AppDomainTests.cs | 1 + .../System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs | 4 ++-- 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/ConversionTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/ConversionTests.cs index c28005480741b0..12c29ec4318a1e 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/ConversionTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/ConversionTests.cs @@ -496,6 +496,7 @@ public static IEnumerable Hex_Decimal_TestData() } [Theory] + [ActiveIssue("Ran out of trampolines of type 2 in '/data/user/0/net.dot.Microsoft.VisualBasic.Core.Tests/files/System.Private.CoreLib.dll' (limit 2000)", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [InlineData(true, 1)] [InlineData(false, 0)] [InlineData("0", 0.0)] diff --git a/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs b/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs index 7c0d860c34c0d9..86b351f2a65cff 100644 --- a/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs +++ b/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs @@ -9,6 +9,7 @@ namespace System.IO.Tests { + [ActiveIssue("Runtime crash, null pointer dereference ?", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public class StreamCopyToTests { [Fact] diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs index 3da256880e8a03..70f887c5d972ec 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs @@ -355,7 +355,7 @@ protected override int GetExpectedSeenLeftCount(int leftCount, int rightCount) } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [MemberData(nameof(JoinMultipleData), new[] { 2, KeyFactor - 1, KeyFactor, KeyFactor + 1, KeyFactor * 2 - 1, KeyFactor * 2, KeyFactor * 2 + 1 })] public static void Join_CustomComparator_LeftWithOrderingColisions(Labeled> left, int leftCount, Labeled> right, int rightCount) { diff --git a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs index b3b056df5ec951..6ccb4cad290418 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs @@ -264,6 +264,7 @@ public void ExecuteAssemblyByName() } [Fact] + [ActiveIssue("Failed to load AOT module TestAppOutsideOfTPA.exe.so", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public void ExecuteAssembly() { CopyTestAssemblies(); diff --git a/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs b/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs index 003e6eedb28c6e..aa9cfa8a21f95c 100644 --- a/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs +++ b/src/libraries/System.Threading.Tasks.Extensions/tests/ValueTaskTests.cs @@ -1168,7 +1168,7 @@ public void Generic_ToString_Success() [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAndroid))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [InlineData(typeof(ValueTask))] public void NonGeneric_AsyncMethodBuilderAttribute_ValueTaskAttributed(Type valueTaskType) { @@ -1182,7 +1182,7 @@ public void NonGeneric_AsyncMethodBuilderAttribute_ValueTaskAttributed(Type valu [Theory] [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsAndroid))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/50722", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [InlineData(typeof(ValueTask<>))] [InlineData(typeof(ValueTask))] [InlineData(typeof(ValueTask))] From f6928944bde4d82368dcb6161bb3d7c4c7d84219 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Wed, 2 Jun 2021 15:45:13 +0300 Subject: [PATCH 27/51] Skip more tests --- .../tests/PipeWriterStreamTests.nonnetstandard.cs | 1 + .../tests/QueryOperators/JoinTests.cs | 5 +++-- .../tests/System/EnvironmentTests.cs | 2 +- src/libraries/tests.proj | 10 ++++++++++ src/tasks/AotCompilerTask/MonoAOTCompiler.props | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs b/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs index 1570fd1ed91474..82419058da4b0f 100644 --- a/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs +++ b/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs @@ -11,6 +11,7 @@ namespace System.IO.Pipelines.Tests { + [ActiveIssue("Runtime crash, null pointer dereference ?", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public class PipeWriterStreamTests { public delegate Task WriteAsyncDelegate(Stream stream, byte[] data); diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs index 70f887c5d972ec..90054ceb1d8ceb 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/JoinTests.cs @@ -7,6 +7,7 @@ namespace System.Linq.Parallel.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static class JoinTests { private const int KeyFactor = 8; @@ -203,7 +204,7 @@ protected override int GetExpectedSeenLeftCount(int leftCount, int rightCount) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Theory] [MemberData(nameof(JoinMultipleData), new[] { 2, KeyFactor - 1, KeyFactor, KeyFactor + 1, KeyFactor * 2 - 1, KeyFactor * 2, KeyFactor * 2 + 1 })] public static void Join_Multiple_LeftWithOrderingColisions(Labeled> left, int leftCount, Labeled> right, int rightCount) { @@ -355,7 +356,7 @@ protected override int GetExpectedSeenLeftCount(int leftCount, int rightCount) } } - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Theory] [MemberData(nameof(JoinMultipleData), new[] { 2, KeyFactor - 1, KeyFactor, KeyFactor + 1, KeyFactor * 2 - 1, KeyFactor * 2, KeyFactor * 2 + 1 })] public static void Join_CustomComparator_LeftWithOrderingColisions(Labeled> left, int leftCount, Labeled> right, int rightCount) { diff --git a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs index b192b0900acd03..32d58e6a604f7a 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs @@ -551,7 +551,7 @@ public unsafe void GetFolderPath_Windows(Environment.SpecialFolder folder) Assert.Equal(folderPath, knownFolder); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [PlatformSpecific(TestPlatforms.AnyUnix)] // Uses P/Invokes public void GetLogicalDrives_Unix_AtLeastOneIsRoot() { diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 1aacf80b0d923e..0ddcaa82db9ebb 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -230,6 +230,16 @@ + + + + + + + + + + diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.props b/src/tasks/AotCompilerTask/MonoAOTCompiler.props index 097758ae0c783b..268e13329a2958 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.props +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.props @@ -17,7 +17,7 @@ - + From 27452e98275246e730bc972da1fd51f4855fa549 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 3 Jun 2021 10:31:12 +0300 Subject: [PATCH 28/51] Skip more tests --- .../Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs | 2 +- .../System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs | 1 + src/libraries/tests.proj | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs index 5437590241a625..fae5009835f1f4 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/NewLateBindingTests.cs @@ -94,7 +94,7 @@ public static IEnumerable LateCall_OptionalValues_Data() static object[] CreateData(string memberName, object[] arguments, Type[] typeArguments, string expectedValue) => new object[] { memberName, arguments, typeArguments, expectedValue }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] [ActiveIssue("https://github.com/dotnet/runtime/issues/51834", typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltWithAggressiveTrimming), nameof(PlatformDetection.IsBrowser))] [MemberData(nameof(LateCall_OptionalValues_Data))] public void LateCall_OptionalValues(string memberName, object[] arguments, Type[] typeArguments, string expectedValue) diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs index 8b81af1ff87afe..ccd7b51ed7d267 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/GroupJoinTests.cs @@ -7,6 +7,7 @@ namespace System.Linq.Parallel.Tests { + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public static class GroupJoinTests { private const int KeyFactor = 8; diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 0ddcaa82db9ebb..aa22dc71f82767 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -232,6 +232,7 @@ + From 562035188d0a2e3c4d62cd72b2247467e6057bbb Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 3 Jun 2021 10:36:06 +0300 Subject: [PATCH 29/51] Remove an active issue attribute since nimt-trampolines parameter has been adjusted --- .../Microsoft.VisualBasic.Core/tests/ConversionTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libraries/Microsoft.VisualBasic.Core/tests/ConversionTests.cs b/src/libraries/Microsoft.VisualBasic.Core/tests/ConversionTests.cs index 12c29ec4318a1e..c28005480741b0 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/tests/ConversionTests.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/tests/ConversionTests.cs @@ -496,7 +496,6 @@ public static IEnumerable Hex_Decimal_TestData() } [Theory] - [ActiveIssue("Ran out of trampolines of type 2 in '/data/user/0/net.dot.Microsoft.VisualBasic.Core.Tests/files/System.Private.CoreLib.dll' (limit 2000)", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [InlineData(true, 1)] [InlineData(false, 0)] [InlineData("0", 0.0)] From 846d69727a1b85292d2b3bd70ed835c630939f31 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 3 Jun 2021 12:55:34 +0300 Subject: [PATCH 30/51] Skip more tests --- src/libraries/tests.proj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 6847f124453bdd..e55224a705d0bb 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -232,12 +232,15 @@ + + + From 075052e6dbf7865fd9dc2cf766a011b54ddddeb5 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 3 Jun 2021 15:00:45 +0300 Subject: [PATCH 31/51] Skip yet another test suite perhaps due to infra issue --- src/libraries/tests.proj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index e55224a705d0bb..5f73b9a2cbc696 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -247,6 +247,7 @@ + From d14d51e82562fa20711c1f494749c4b27c4ca582 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 3 Jun 2021 18:35:02 +0300 Subject: [PATCH 32/51] Add active issue links --- .../tests/PipeWriterStreamTests.nonnetstandard.cs | 2 +- src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs | 2 +- .../tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs | 2 +- .../System.Runtime.Extensions/tests/System/AppDomainTests.cs | 2 +- src/libraries/tests.proj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs b/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs index 82419058da4b0f..7f7cb678b5eb1d 100644 --- a/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs +++ b/src/libraries/System.IO.Pipelines/tests/PipeWriterStreamTests.nonnetstandard.cs @@ -11,7 +11,7 @@ namespace System.IO.Pipelines.Tests { - [ActiveIssue("Runtime crash, null pointer dereference ?", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/53679", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public class PipeWriterStreamTests { public delegate Task WriteAsyncDelegate(Stream stream, byte[] data); diff --git a/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs b/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs index 86b351f2a65cff..24498e1385380e 100644 --- a/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs +++ b/src/libraries/System.IO/tests/Stream/Stream.CopyToTests.cs @@ -9,7 +9,7 @@ namespace System.IO.Tests { - [ActiveIssue("Runtime crash, null pointer dereference ?", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/53679", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public class StreamCopyToTests { [Fact] diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs index a9689d049dc80d..b9e30ac12dca2f 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/Tests/MetadataLoadContext/PathAssemblyResolver.cs @@ -324,7 +324,7 @@ public static void DuplicateSignedAndUnsignedAssemblies() } [Fact] - [ActiveIssue("System.IO.FileNotFoundException", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/53680", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public static void RelocatableAssembly() { string coreAssemblyPath = TestUtils.GetPathToCoreAssembly(); diff --git a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs index 6ccb4cad290418..6937b3979d18b9 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/AppDomainTests.cs @@ -264,7 +264,7 @@ public void ExecuteAssemblyByName() } [Fact] - [ActiveIssue("Failed to load AOT module TestAppOutsideOfTPA.exe.so", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/53681", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public void ExecuteAssembly() { CopyTestAssemblies(); diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 5f73b9a2cbc696..3aa8487f83eb6b 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -228,7 +228,7 @@ - + From 5870d41363d4d536df549ee83625d85798533d9a Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Fri, 4 Jun 2021 11:52:35 +0300 Subject: [PATCH 33/51] Try re-enabling some test suites which previously had no CI results --- src/libraries/tests.proj | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 1cfac41b047ac0..f44e4e3fe9c121 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -237,19 +237,6 @@ - - - - - - - - - - - - - From e6a96027737fc2198cb56ace2b3222284407d5fa Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Fri, 4 Jun 2021 15:10:38 +0300 Subject: [PATCH 34/51] Add an active issue --- .../System.IO/tests/Stream/SyncStreamConformanceTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs b/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs index 3eca83cf8fbb12..bb0b20cb929c27 100644 --- a/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs +++ b/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs @@ -5,6 +5,7 @@ namespace System.IO.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/53679", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public class SyncStreamConformanceTests : StandaloneStreamConformanceTests { protected override bool NopFlushCompletesSynchronously => false; From 54e6bae354fc4f64684a7032761072eec9a3d7a5 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Fri, 4 Jun 2021 16:07:51 +0300 Subject: [PATCH 35/51] Add XUnit using to enable ActiveIssue attribute --- .../System.IO/tests/Stream/SyncStreamConformanceTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs b/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs index bb0b20cb929c27..34a798e7a64ff6 100644 --- a/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs +++ b/src/libraries/System.IO/tests/Stream/SyncStreamConformanceTests.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Threading.Tasks; +using Xunit; namespace System.IO.Tests { From 376bdb4d9a99883f7ffa3a1b8f593e8a22b71b51 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Wed, 9 Jun 2021 11:30:35 +0300 Subject: [PATCH 36/51] Add '$(RunDisabledAndroidTests)' != 'true' --- src/libraries/tests.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 76428e32e13d72..c0978d2c9b5c5d 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -177,7 +177,7 @@
- + From 1a6e99f1cc7d0a795a9c936a987c2880c4c8cce8 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Wed, 9 Jun 2021 11:49:41 +0300 Subject: [PATCH 37/51] Add an active issue to the disabled test suites --- src/libraries/tests.proj | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index c0978d2c9b5c5d..5bbd22f87c3180 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -209,34 +209,35 @@ - + - + - + - + - + - + - + + From e5b2dab5dfc79f4e11f80e3cae3d81a568e56457 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Wed, 9 Jun 2021 12:55:59 +0300 Subject: [PATCH 38/51] Try re-using EnableAggressiveTrimming --- eng/pipelines/runtime-staging.yml | 2 +- eng/testing/tests.mobile.targets | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/eng/pipelines/runtime-staging.yml b/eng/pipelines/runtime-staging.yml index 9d44433a136b23..0aae95bb51cf57 100644 --- a/eng/pipelines/runtime-staging.yml +++ b/eng/pipelines/runtime-staging.yml @@ -197,7 +197,7 @@ jobs: jobParameters: testGroup: innerloop nameSuffix: AllSubsets_AOT_Mono - buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true /p:EnableTrimming=true + buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:RunAOTCompilation=true /p:EnableAggressiveTrimming=true timeoutInMinutes: 180 condition: >- or( diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 88b1138aeb53f4..83d95eae00859f 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -26,12 +26,6 @@ --expected-exit-code $(ExpectedExitCode)
- - true - - true - - $(AdditionalXHarnessArguments) --arg=-m=$(XUnitMethodName) From c684fc3102ad4099c98bb0e79d37a412d265c73d Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Wed, 9 Jun 2021 14:58:51 +0300 Subject: [PATCH 39/51] Update tests.proj --- src/libraries/tests.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 5bbd22f87c3180..2c9b7b0adad550 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -177,7 +177,7 @@
- + From 8697a56bed64ff159450b98116ac234bfccfc2ad Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 10 Jun 2021 12:00:25 +0300 Subject: [PATCH 40/51] Use tvOS in PlatformDetection.IsNotDeviceAOT --- .../Common/tests/TestUtilities/System/PlatformDetection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 5d4754f27ecda8..cf75f892372dc3 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -29,11 +29,11 @@ public static partial class PlatformDetection public static bool IsFreeBSD => RuntimeInformation.IsOSPlatform(OSPlatform.Create("FREEBSD")); public static bool IsNetBSD => RuntimeInformation.IsOSPlatform(OSPlatform.Create("NETBSD")); public static bool IsAndroid => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ANDROID")); - public static bool IsiOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")); public static bool IsAndroidAOT => IsAndroid && IsMonoAOT; public static bool IsNotAndroidAOT => !IsAndroidAOT; - public static bool IsNotDeviceAOT => !((IsAndroid || IsiOS) && IsMonoAOT); + public static bool IsiOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("IOS")); public static bool IstvOS => RuntimeInformation.IsOSPlatform(OSPlatform.Create("TVOS")); + public static bool IsNotDeviceAOT => !((IsAndroid || IsiOS || IstvOS) && IsMonoAOT); public static bool IsMacCatalyst => RuntimeInformation.IsOSPlatform(OSPlatform.Create("MACCATALYST")); public static bool Isillumos => RuntimeInformation.IsOSPlatform(OSPlatform.Create("ILLUMOS")); public static bool IsSolaris => RuntimeInformation.IsOSPlatform(OSPlatform.Create("SOLARIS")); From 4ecdf5b55450e08fcd519e228029245df6919f53 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 10 Jun 2021 13:14:05 +0300 Subject: [PATCH 41/51] Exclude Microsoft.Extensions.DependencyModel.Tests test suite --- .../tests/CompilationLibraryTests.cs | 4 ++-- .../tests/CompositeResolverTests.cs | 1 - .../tests/DependencyContextBuilderTests.cs | 12 ++++++------ .../tests/DependencyContextJsonReaderTest.cs | 18 +++++++++--------- .../tests/DependencyContextJsonWriterTests.cs | 2 +- .../tests/DependencyContextLoaderTests.cs | 4 ++-- .../tests/DependencyContextTests.cs | 10 +++++----- src/libraries/tests.proj | 3 +++ 8 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs index 9ff485eef72e3d..a3f2d8acc9e924 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompilationLibraryTests.cs @@ -13,7 +13,7 @@ namespace Microsoft.Extensions.DependencyModel.Tests { public class CompilationLibraryTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void ResolveReferencePathsAcceptsCustomResolvers() { var fail = new Mock(); @@ -48,7 +48,7 @@ public void ResolveReferencePathsAcceptsCustomResolvers() Times.Never()); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void ResolveReferencePathsAcceptsNullCustomResolvers() { var library = TestLibraryFactory.Create(); diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs index 5a8e78af9c62a8..99fb51405af9b7 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/CompositeResolverTests.cs @@ -12,7 +12,6 @@ namespace Microsoft.Extensions.DependencyModel.Tests { - [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] public class CompositeResolverTests { [Fact] diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextBuilderTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextBuilderTests.cs index d3b790ac03e357..b6f64911bcf5c9 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextBuilderTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextBuilderTests.cs @@ -122,7 +122,7 @@ public void TakesServicableFromPackageDescription() lib.Serviceable.Should().BeTrue(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void FillsRuntimeLibraryProperties() { var context = Build(runtimeExports: new[] @@ -200,7 +200,7 @@ public void FillsRuntimeLibraryProperties() asm.HashPath.Should().BeNull(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void FiltersDuplicatedDependencies() { var context = Build(runtimeExports: new[] @@ -229,7 +229,7 @@ public void FiltersDuplicatedDependencies() lib.Dependencies.Should().OnlyContain(l => l.Name == "System.Collections" && l.Version == "2.0.0"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void FillsCompileLibraryProperties() { var context = Build(compilationExports: new[] @@ -285,7 +285,7 @@ public void FillsCompileLibraryProperties() asm.HashPath.Should().BeNull(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void FillsResources() { var context = Build(runtimeExports: new[] @@ -303,7 +303,7 @@ public void FillsResources() lib.ResourceAssemblies.Should().OnlyContain(l => l.Locale == "en-US" && l.Path == "resources/en-US/Pack.Age.dll"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void ReferenceAssembliesPathRelativeToDefaultRoot() { var context = Build(compilationExports: new[] @@ -320,7 +320,7 @@ public void ReferenceAssembliesPathRelativeToDefaultRoot() asm.Assemblies.Should().OnlyContain(a => a == Path.Combine("sub", "System.Collections.dll")); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void SkipsBuildDependencies() { var context = Build(compilationExports: new[] diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs index 589937e663a675..fcdca9eb8d40eb 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs @@ -229,7 +229,7 @@ public void IgnoresExtraTopLevelNodes() context.Target.Framework.Should().Be(".NETCoreApp,Version=v1.0"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void ReadsRuntimeGraph() { var context = Read( @@ -253,7 +253,7 @@ public void ReadsRuntimeGraph() .Fallbacks.Should().BeEquivalentTo("linux-x64", "unix"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void ReadsCompilationTarget() { var context = Read( @@ -324,7 +324,7 @@ public void RejectsMissingLibrary() Assert.Equal($"Cannot find library information for System.Banana/1.0.0", exception.Message); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void IgnoresUnknownPropertiesInLibrary() { var context = Read( @@ -362,7 +362,7 @@ public void IgnoresUnknownPropertiesInLibrary() package.HashPath.Should().BeNull(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void ReadsCompilationTargetWithNullPathAndHashPath() { var context = Read( @@ -401,7 +401,7 @@ public void ReadsCompilationTargetWithNullPathAndHashPath() package.HashPath.Should().BeNull(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void ReadsCompilationTargetWithMissingPathAndHashPath() { var context = Read( @@ -481,13 +481,13 @@ public void DoesNotReadRuntimeLibraryFromCompilationOnlyEntries() } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void ReadsRuntimeLibrariesWithSubtargetsFromMainTargetForPortable() { ReadsRuntimeLibrariesWithSubtargetsFromMainTargetForPortableCore(false); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void ReadsRuntimeLibrariesWithSubtargetsFromMainTargetForPortableWithAssemblyVersions() { ReadsRuntimeLibrariesWithSubtargetsFromMainTargetForPortableCore(true); @@ -592,7 +592,7 @@ private void ReadsRuntimeLibrariesWithSubtargetsFromMainTargetForPortableCore(bo package.NativeLibraryGroups.GetRuntimeAssets("win7-x64").Should().Contain("lib/win7/Banana.dll"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void ReadsRuntimeTargetPlaceholdersAsEmptyGroups() { var context = Read( @@ -628,7 +628,7 @@ public void ReadsRuntimeTargetPlaceholdersAsEmptyGroups() .Which.AssetPaths.Should().BeEmpty(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void IgnoresUnknownPropertiesInRuntimeTargets() { var context = Read( diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs index 41fe4c0f10d280..d8c29af8d97209 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs @@ -55,7 +55,7 @@ public DependencyContext Create( ); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void SavesRuntimeGraph() { var result = Save(Create( diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs index 94078f5d66c3bf..c168143d538c29 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs @@ -11,7 +11,7 @@ namespace Microsoft.Extensions.DependencyModel.Tests { public class DependencyContextLoaderTests { - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "GetEntryAssembly() returns null")] public void LoadLoadsExtraPaths() { @@ -77,7 +77,7 @@ public void LoadLoadsExtraPaths() context.RuntimeLibraries.Should().Contain(l => l.Name == "System.Banana"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void LoadCanLoadANonEntryAssembly() { var loader = new DependencyContextLoader(); diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs index 11273461f454c7..4b6c4fc85b3a31 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs +++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextTests.cs @@ -11,7 +11,7 @@ namespace Microsoft.Extensions.DependencyModel.Tests { public class DependencyContextTests { - [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Theory] [InlineData("System.Collections.dll", "System.Collections")] [InlineData("System.Collections.ni.dll", "System.Collections")] [InlineData("mscorlib", "mscorlib")] @@ -38,7 +38,7 @@ public void GetRuntimeAssemblyNamesExtractsCorrectAssemblyName(string path, stri assets.Should().OnlyContain(a => a.Name == expected); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void GetRuntimeAssemblyNamesReturnsRIDLessAssetsIfNoRIDSpecificAssetsInLibrary() { var context = BuildTestContext(); @@ -47,7 +47,7 @@ public void GetRuntimeAssemblyNamesReturnsRIDLessAssetsIfNoRIDSpecificAssetsInLi assets.Should().OnlyContain(a => a.Name == "System.Collections"); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void GetRuntimeAssemblyNamesReturnsMostSpecificAssetIfRIDSpecificAssetInLibrary() { var context = BuildTestContext(); @@ -65,7 +65,7 @@ public void GetRuntimeAssemblyNamesReturnsEmptyIfEmptyRuntimeGroupPresent() assets.Should().BeEmpty(); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void GetRuntimeNativeAssetsReturnsEmptyIfNoGroupsMatch() { var context = BuildTestContext(); @@ -247,7 +247,7 @@ public void MergeMergesLibrariesWithDifferentCasing() }); } - [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotDeviceAOT))] + [Fact] public void MergeMergesRuntimeGraph() { var context = new DependencyContext( diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index c7e6147da2592a..dd93da45007742 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -237,6 +237,9 @@ + + + From 874e9c7b0ffeca0177b4a5a648c8f5a7a404391e Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 10 Jun 2021 15:42:45 +0300 Subject: [PATCH 42/51] Exclude Microsoft.NETCore.Platforms.BuildTasks.Tests.GenerateRuntimeGraphTests --- .../tests/GenerateRuntimeGraphTests.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs b/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs index 53bc785e09deee..bb6433936b9ffb 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs +++ b/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs @@ -12,6 +12,7 @@ namespace Microsoft.NETCore.Platforms.BuildTasks.Tests { + [ActiveIssue("https://github.com/dotnet/runtime/issues/53999", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] public class GenerateRuntimeGraphTests { private Log _log; @@ -192,7 +193,6 @@ public void CanAddArchitectureToExistingGroups() AssertRuntimeGraphAdditions(additionalRIDs, expectedAdditions); } - [Fact] public void CanAddArchitectureAndVersionToExistingGroups() { @@ -236,6 +236,5 @@ public void CanAddNewGroups() AssertRuntimeGraphAdditions(additionalRIDs, expectedAdditions, "linux-musl"); } - } } From db088de28fc5951f8ec38e77065e244fc54db66a Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 10 Jun 2021 16:27:04 +0300 Subject: [PATCH 43/51] Using --- .../tests/GenerateRuntimeGraphTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs b/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs index bb6433936b9ffb..30f35e026efd74 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs +++ b/src/libraries/Microsoft.NETCore.Platforms/tests/GenerateRuntimeGraphTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System; using System.Linq; using System.Runtime.CompilerServices; using Microsoft.Build.Evaluation; From 72389de6bfefa08a2407b44247d1f8012bd993d2 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Thu, 10 Jun 2021 16:27:34 +0300 Subject: [PATCH 44/51] Enable debugger support --- .../tests/System.Composition.TypedParts.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/System.Composition.TypedParts/tests/System.Composition.TypedParts.Tests.csproj b/src/libraries/System.Composition.TypedParts/tests/System.Composition.TypedParts.Tests.csproj index 293590ae99aff9..5b39779f33d912 100644 --- a/src/libraries/System.Composition.TypedParts/tests/System.Composition.TypedParts.Tests.csproj +++ b/src/libraries/System.Composition.TypedParts/tests/System.Composition.TypedParts.Tests.csproj @@ -1,7 +1,7 @@ $(NetCoreAppCurrent);net461 - true + true From 2933ae843278fef9082062571d54aac31c3a2ab2 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Fri, 11 Jun 2021 10:40:28 +0300 Subject: [PATCH 45/51] More debugger support --- src/libraries/System.Linq/tests/System.Linq.Tests.csproj | 2 +- .../tests/System.Threading.Channels.Tests.csproj | 2 +- .../tests/System.Threading.Tasks.Dataflow.Tests.csproj | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Linq/tests/System.Linq.Tests.csproj b/src/libraries/System.Linq/tests/System.Linq.Tests.csproj index cd15cfbbf59d5d..91617d8d5f2910 100644 --- a/src/libraries/System.Linq/tests/System.Linq.Tests.csproj +++ b/src/libraries/System.Linq/tests/System.Linq.Tests.csproj @@ -1,7 +1,7 @@ $(NetCoreAppCurrent) - true + true diff --git a/src/libraries/System.Threading.Channels/tests/System.Threading.Channels.Tests.csproj b/src/libraries/System.Threading.Channels/tests/System.Threading.Channels.Tests.csproj index 45be5f85721731..3f1345d7446e05 100644 --- a/src/libraries/System.Threading.Channels/tests/System.Threading.Channels.Tests.csproj +++ b/src/libraries/System.Threading.Channels/tests/System.Threading.Channels.Tests.csproj @@ -1,7 +1,7 @@ $(NetCoreAppCurrent);net461 - true + true diff --git a/src/libraries/System.Threading.Tasks.Dataflow/tests/System.Threading.Tasks.Dataflow.Tests.csproj b/src/libraries/System.Threading.Tasks.Dataflow/tests/System.Threading.Tasks.Dataflow.Tests.csproj index d78224779d494a..78d2ab1d3d659f 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/tests/System.Threading.Tasks.Dataflow.Tests.csproj +++ b/src/libraries/System.Threading.Tasks.Dataflow/tests/System.Threading.Tasks.Dataflow.Tests.csproj @@ -2,6 +2,7 @@ true $(NetCoreAppCurrent);net461 + true From c1ab593f1ba2bab0f754cb2b14ef1ece35e7aed2 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Fri, 11 Jun 2021 10:40:57 +0300 Subject: [PATCH 46/51] Same issue as on browser --- .../System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs b/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs index 2a25ea71961915..bfd03f54e2f710 100644 --- a/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs +++ b/src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs @@ -1502,6 +1502,7 @@ public void NonValidated_SetMultipleValuesOnSingleValueHeader_AllHeaderValuesRet } [ActiveIssue("https://github.com/dotnet/runtime/issues/53647", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/53647", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [Fact] public void NonValidated_ValidAndInvalidValues_DictionaryMembersWork() { @@ -1540,6 +1541,7 @@ public void NonValidated_ValidAndInvalidValues_DictionaryMembersWork() } [ActiveIssue("https://github.com/dotnet/runtime/issues/53647", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/53647", typeof(PlatformDetection), nameof(PlatformDetection.IsAndroidAOT))] [Fact] public void NonValidated_ValidInvalidAndRaw_AllReturned() { From cfb2051808e743c8fb0ba66c6d03a98e8162c4ed Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Fri, 11 Jun 2021 10:41:23 +0300 Subject: [PATCH 47/51] Method is not supported --- .../StreamConformanceTests/System/IO/StreamConformanceTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs index d41e07217ee335..a5899914b4bb79 100644 --- a/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs +++ b/src/libraries/Common/tests/StreamConformanceTests/System/IO/StreamConformanceTests.cs @@ -2365,7 +2365,7 @@ public static IEnumerable CopyToAsync_AllDataCopied_MemberData() => public virtual async Task CopyToAsync_AllDataCopied_Large(bool useAsync) => await CopyToAsync_AllDataCopied(1024 * 1024, useAsync); - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotAndroidAOT))] // System.NotSupportedException : Specified method is not supported. [MemberData(nameof(CopyToAsync_AllDataCopied_MemberData))] [ActiveIssue("https://github.com/dotnet/runtime/issues/51371", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] public virtual async Task CopyToAsync_AllDataCopied(int byteCount, bool useAsync) From 0600168c49b78693cee1677f12bb0cf7debb781c Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Fri, 11 Jun 2021 13:36:52 +0300 Subject: [PATCH 48/51] Bump ngsharedvt-trampolines value up to 8800 ? --- src/tasks/AotCompilerTask/MonoAOTCompiler.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks/AotCompilerTask/MonoAOTCompiler.props b/src/tasks/AotCompilerTask/MonoAOTCompiler.props index 268e13329a2958..9b7d4821af7965 100644 --- a/src/tasks/AotCompilerTask/MonoAOTCompiler.props +++ b/src/tasks/AotCompilerTask/MonoAOTCompiler.props @@ -20,7 +20,7 @@ - + From 10e2e48b425c8b2c5a6e2530c03bd82bd1cb145b Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 22 Jun 2021 13:55:50 -0400 Subject: [PATCH 49/51] Flip back llvm flag --- eng/testing/tests.mobile.targets | 3 +++ .../AOT/Android.Device_Emulator.Aot.Test.csproj | 1 + 2 files changed, 4 insertions(+) diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets index 83d95eae00859f..f3c69aca3b1a41 100644 --- a/eng/testing/tests.mobile.targets +++ b/eng/testing/tests.mobile.targets @@ -80,6 +80,9 @@ AndroidTestRunner.dll + + true + @(MonoAOTCompilerDefaultAotArguments, ';') diff --git a/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj b/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj index 49fd6653dde851..5c4dd1016e6447 100644 --- a/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj +++ b/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj @@ -3,6 +3,7 @@ Exe false true + true true $(NetCoreAppCurrent) Android.Device_Emulator.Aot.Test.dll From e26477a07e0c3d097740b258e409c1e355f781a3 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 22 Jun 2021 15:04:59 -0400 Subject: [PATCH 50/51] quick fix --- .../Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj b/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj index 5c4dd1016e6447..10b451529ec828 100644 --- a/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj +++ b/src/tests/FunctionalTests/Android/Device_Emulator/AOT/Android.Device_Emulator.Aot.Test.csproj @@ -3,7 +3,7 @@ Exe false true - true + false true $(NetCoreAppCurrent) Android.Device_Emulator.Aot.Test.dll From 2cefff0ccace2d1c0517b6b63eb777e91acd0032 Mon Sep 17 00:00:00 2001 From: Maxim Lipnin Date: Tue, 29 Jun 2021 11:08:55 +0300 Subject: [PATCH 51/51] Re-enable System.Linq.Expressions.Tests test suite to see any failures --- src/libraries/tests.proj | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 3a3d99725f975b..d2bd1f00d59d54 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -199,9 +199,6 @@ - - -