diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index 18b342db71ac0..1cfa4ba1cdeca 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -26,7 +26,7 @@ $(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll $(CoreCLRAotSdkDir) $(NetCoreAppCurrentTestHostSharedFrameworkPath) - $(NoWarn);IL3050;IL3051;IL3052;IL3055;IL1005;IL3002 + $(NoWarn);IL3050;IL3051;IL3052;IL3054;IL3055;IL1005;IL3002 false true diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/FlowAnnotations.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/FlowAnnotations.cs index 8bb4badad9b70..1a4844b8f418b 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/FlowAnnotations.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Dataflow/FlowAnnotations.cs @@ -311,16 +311,18 @@ protected override TypeAnnotations CreateValueFromKey(TypeDesc key) TypeDesc baseType = key.BaseType; while (baseType != null) { - TypeDefinition baseTypeDef = reader.GetTypeDefinition(((EcmaType)baseType.GetTypeDefinition()).Handle); - typeAnnotation |= GetMemberTypesForDynamicallyAccessedMembersAttribute(reader, baseTypeDef.GetCustomAttributes()); + var ecmaBaseType = (EcmaType)baseType.GetTypeDefinition(); + TypeDefinition baseTypeDef = ecmaBaseType.MetadataReader.GetTypeDefinition(ecmaBaseType.Handle); + typeAnnotation |= GetMemberTypesForDynamicallyAccessedMembersAttribute(ecmaBaseType.MetadataReader, baseTypeDef.GetCustomAttributes()); baseType = baseType.BaseType; } // And inherit them from interfaces foreach (DefType runtimeInterface in key.RuntimeInterfaces) { - TypeDefinition interfaceTypeDef = reader.GetTypeDefinition(((EcmaType)runtimeInterface.GetTypeDefinition()).Handle); - typeAnnotation |= GetMemberTypesForDynamicallyAccessedMembersAttribute(reader, interfaceTypeDef.GetCustomAttributes()); + var ecmaInterface = (EcmaType)runtimeInterface.GetTypeDefinition(); + TypeDefinition interfaceTypeDef = ecmaInterface.MetadataReader.GetTypeDefinition(ecmaInterface.Handle); + typeAnnotation |= GetMemberTypesForDynamicallyAccessedMembersAttribute(ecmaInterface.MetadataReader, interfaceTypeDef.GetCustomAttributes()); } } catch (TypeSystemException) diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/EmbeddedTrimmingDescriptorNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/EmbeddedTrimmingDescriptorNode.cs index b50b35cf7c4bf..60aa822c2759a 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/EmbeddedTrimmingDescriptorNode.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/EmbeddedTrimmingDescriptorNode.cs @@ -60,7 +60,7 @@ public override IEnumerable GetStaticDependencies(NodeFacto protected override string GetName(NodeFactory factory) { - return $"Getting embedded descriptor file from {_module.GetDisplayName()}"; + return $"Getting embedded descriptor file from {_module.ToString()}"; } public override bool InterestingForDynamicDependencyAnalysis => false; diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectableFieldNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectableFieldNode.cs index 4f4cd477d44e3..dd5b429d10438 100644 --- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectableFieldNode.cs +++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ReflectableFieldNode.cs @@ -83,14 +83,17 @@ public override IEnumerable GetStaticDependencies(NodeFacto } } - // Runtime reflection stack needs to obtain the type handle of the field - // (but there's no type handles for function pointers) - TypeDesc fieldTypeToCheck = _field.FieldType; - while (fieldTypeToCheck.IsParameterizedType) - fieldTypeToCheck = ((ParameterizedType)fieldTypeToCheck).ParameterType; - - if (!fieldTypeToCheck.IsFunctionPointer) - dependencies.Add(factory.MaximallyConstructableType(_field.FieldType.NormalizeInstantiation()), "Type of the field"); + if (!_field.OwningType.IsCanonicalSubtype(CanonicalFormKind.Any)) + { + // Runtime reflection stack needs to obtain the type handle of the field + // (but there's no type handles for function pointers) + TypeDesc fieldTypeToCheck = _field.FieldType; + while (fieldTypeToCheck.IsParameterizedType) + fieldTypeToCheck = ((ParameterizedType)fieldTypeToCheck).ParameterType; + + if (!fieldTypeToCheck.IsFunctionPointer) + dependencies.Add(factory.MaximallyConstructableType(_field.FieldType.NormalizeInstantiation()), "Type of the field"); + } return dependencies; } diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextLoaderTests.cs index e7e5ce6ecb816..71f7a3f7e23ca 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; @@ -76,7 +77,8 @@ public void LoadLoadsExtraPaths() context.RuntimeLibraries.Should().Contain(l => l.Name == "System.Banana"); } - [Fact] + // Load method is marked RequiresAssemblyFiles so this test doesn't make sense on single file + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void LoadCanLoadANonEntryAssembly() { var loader = new DependencyContextLoader(); diff --git a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/Microsoft.Extensions.FileSystemGlobbing.Tests.csproj b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/Microsoft.Extensions.FileSystemGlobbing.Tests.csproj index 18043e2391cb0..f96695c91c015 100644 --- a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/Microsoft.Extensions.FileSystemGlobbing.Tests.csproj +++ b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/Microsoft.Extensions.FileSystemGlobbing.Tests.csproj @@ -5,6 +5,10 @@ true + + + + diff --git a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/default.rd.xml b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/default.rd.xml new file mode 100644 index 0000000000000..2c14c77dbb3c3 --- /dev/null +++ b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/tests/default.rd.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs index fe26636fa8501..b35db51ec0da2 100644 --- a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs +++ b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs @@ -108,6 +108,7 @@ public void CreateHostBuilderPattern_CanFindHostBuilder() [Fact] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateHostBuilderPatternTestSite.Program))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(Host))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void CreateHostBuilderPattern_CanFindServiceProvider() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(CreateHostBuilderPatternTestSite.Program).Assembly); @@ -137,6 +138,7 @@ public void CreateHostBuilderPattern__Invalid_CantFindServiceProvider() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void NoSpecialEntryPointPattern() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(NoSpecialEntryPointPattern.Program).Assembly, s_WaitTimeout); @@ -235,6 +237,7 @@ public void NoSpecialEntryPointPatternHangs() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternMainNoArgs.Program))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void NoSpecialEntryPointPatternMainNoArgs() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(NoSpecialEntryPointPatternMainNoArgs.Program).Assembly, s_WaitTimeout); @@ -244,6 +247,8 @@ public void NoSpecialEntryPointPatternMainNoArgs() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "TopLevelStatements")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void TopLevelStatements() { var assembly = Assembly.Load("TopLevelStatements"); @@ -254,6 +259,7 @@ public void TopLevelStatements() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "TopLevelStatementsTestsTimeout")] public void TopLevelStatementsTestsTimeout() { var assembly = Assembly.Load("TopLevelStatementsTestsTimeout"); @@ -264,6 +270,8 @@ public void TopLevelStatementsTestsTimeout() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] + [DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "ApplicationNameSetFromArgument")] public void ApplicationNameSetFromArgument() { Assembly assembly = Assembly.Load("ApplicationNameSetFromArgument"); @@ -276,6 +284,7 @@ public void ApplicationNameSetFromArgument() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void NoSpecialEntryPointPatternCanRunInParallel() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(NoSpecialEntryPointPattern.Program).Assembly, s_WaitTimeout); diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostBuilderTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostBuilderTests.cs index 524543124033c..602d32b195738 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostBuilderTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostBuilderTests.cs @@ -644,7 +644,9 @@ public void HostServicesSameServiceProviderAsInHostBuilder() var hostBuilder = Host.CreateDefaultBuilder(); var host = hostBuilder.Build(); - var type = hostBuilder.GetType(); + // Use typeof so that trimming can see the field being used below + var type = typeof(HostBuilder); + Assert.Equal(hostBuilder.GetType(), type); var field = type.GetField("_appServices", BindingFlags.Instance | BindingFlags.NonPublic)!; var appServicesFromHostBuilder = (IServiceProvider)field.GetValue(hostBuilder)!; Assert.Same(appServicesFromHostBuilder, host.Services); diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs index b3133dba3be88..d55df715fc903 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Internal/HostTests.cs @@ -565,7 +565,8 @@ public async Task HostShutsDownWhenTokenTriggers() Assert.Equal(1, service.DisposeCount); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task HostStopAsyncCanBeCancelledEarly() { var service = new Mock(); @@ -596,7 +597,8 @@ public async Task HostStopAsyncCanBeCancelledEarly() } } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task HostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire() { var service = new Mock(); @@ -628,7 +630,8 @@ public async Task HostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire() } } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task WebHostStopAsyncUsesDefaultTimeoutIfNoTokenProvided() { var service = new Mock(); @@ -1151,7 +1154,8 @@ public async Task Host_InvokesConfigureServicesMethodsOnlyOnce() } } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Dispose_DisposesAppConfigurationProviders() { var providerMock = new Mock().As(); @@ -1175,7 +1179,8 @@ public void Dispose_DisposesAppConfigurationProviders() providerMock.Verify(c => c.Dispose(), Times.AtLeastOnce()); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void Dispose_DisposesHostConfigurationProviders() { var providerMock = new Mock().As(); @@ -1250,7 +1255,8 @@ public async Task HostCallsDisposeAsyncOnServiceProviderWhenDisposeAsyncCalled() } } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task DisposeAsync_DisposesAppConfigurationProviders() { var providerMock = new Mock().As(); @@ -1274,7 +1280,8 @@ public async Task DisposeAsync_DisposesAppConfigurationProviders() providerMock.Verify(c => c.Dispose(), Times.AtLeastOnce()); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public async Task DisposeAsync_DisposesHostConfigurationProviders() { var providerMock = new Mock().As(); @@ -1298,7 +1305,8 @@ public async Task DisposeAsync_DisposesHostConfigurationProviders() providerMock.Verify(c => c.Dispose(), Times.AtLeastOnce()); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] public void ThrowExceptionForCustomImplementationOfIHostApplicationLifetime() { var hostApplicationLifetimeMock = new Mock(); diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryExtensionsTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryExtensionsTest.cs index ab237491568d2..7b96a62a48adf 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryExtensionsTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerFactoryExtensionsTest.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 Microsoft.Extensions.Logging.Testing; using Moq; using Xunit; @@ -9,7 +10,8 @@ namespace Microsoft.Extensions.Logging.Test { public class LoggerFactoryExtensionsTest { - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34091", TestRuntimes.Mono)] public void LoggerFactoryCreateOfT_CallsCreateWithCorrectName() { @@ -28,7 +30,8 @@ public void LoggerFactoryCreateOfT_CallsCreateWithCorrectName() factory.Verify(f => f.CreateLogger(expected)); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34091", TestRuntimes.Mono)] public void LoggerFactoryCreateOfT_SingleGeneric_CallsCreateWithCorrectName() { @@ -44,7 +47,8 @@ public void LoggerFactoryCreateOfT_SingleGeneric_CallsCreateWithCorrectName() Assert.NotNull(logger); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34091", TestRuntimes.Mono)] public void LoggerFactoryCreateOfT_TwoGenerics_CallsCreateWithCorrectName() { @@ -115,7 +119,8 @@ public void CreatesLoggerName_OnMultipleTypeArgumentGenericType_CreatesWithoutGe } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34091", TestRuntimes.Mono)] public void LoggerFactoryCreate_CallsCreateWithCorrectName() { @@ -134,7 +139,8 @@ public void LoggerFactoryCreate_CallsCreateWithCorrectName() factory.Verify(f => f.CreateLogger(expected)); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34091", TestRuntimes.Mono)] public void LoggerFactoryCreate_SingleGeneric_CallsCreateWithCorrectName() { @@ -150,7 +156,8 @@ public void LoggerFactoryCreate_SingleGeneric_CallsCreateWithCorrectName() Assert.NotNull(logger); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34091", TestRuntimes.Mono)] public void LoggerFactoryCreate_TwoGenerics_CallsCreateWithCorrectName() { diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerTest.cs index a2a635077ae52..75bc1f25892dc 100644 --- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging/tests/Common/LoggerTest.cs @@ -124,7 +124,8 @@ public void LoggerCanGetProviderAfterItIsCreated() Assert.Equal(new[] { "provider1.Test-Hello" }, store); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34091", TestRuntimes.Mono)] public void ScopesAreNotCreatedForDisabledLoggers() { @@ -150,7 +151,8 @@ public void ScopesAreNotCreatedForDisabledLoggers() logger.Verify(l => l.BeginScope(It.IsAny()), Times.Never); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34091", TestRuntimes.Mono)] public void ScopesAreNotCreatedWhenScopesAreDisabled() { @@ -175,7 +177,8 @@ public void ScopesAreNotCreatedWhenScopesAreDisabled() logger.Verify(l => l.BeginScope(It.IsAny()), Times.Never); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34091", TestRuntimes.Mono)] public void ScopesAreNotCreatedInIScopeProviderWhenScopesAreDisabled() { @@ -208,7 +211,8 @@ public void ScopesAreNotCreatedInIScopeProviderWhenScopesAreDisabled() Assert.Equal(0, scopeCount); } - [Fact] + // Moq heavily utilizes RefEmit, which does not work on most aot workloads + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsReflectionEmitSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34091", TestRuntimes.Mono)] public void CaptureScopesIsReadFromConfiguration() { diff --git a/src/libraries/System.Reflection.Context/tests/CustomAssemblyTests.cs b/src/libraries/System.Reflection.Context/tests/CustomAssemblyTests.cs index 763f03ede1f11..ff88d07247baf 100644 --- a/src/libraries/System.Reflection.Context/tests/CustomAssemblyTests.cs +++ b/src/libraries/System.Reflection.Context/tests/CustomAssemblyTests.cs @@ -75,7 +75,8 @@ public void GetLoadedModulesTest() { Module[] loadedModules = _customAssembly.GetLoadedModules(true); Assert.Single(loadedModules); - Assert.Equal(typeof(CustomAssemblyTests).Assembly.GetName().Name + ".dll", loadedModules[0].Name); + if (PlatformDetection.HasAssemblyFiles) + Assert.Equal(typeof(CustomAssemblyTests).Assembly.GetName().Name + ".dll", loadedModules[0].Name); Assert.All(loadedModules, (mod) => Assert.Equal(ProjectionConstants.CustomModule, mod.GetType().FullName)); } @@ -95,12 +96,13 @@ public void GetModulesTest() { Module[] modules = _customAssembly.GetModules(true); Assert.Single(modules); - Assert.Equal(typeof(CustomAssemblyTests).Assembly.GetName().Name + ".dll", modules[0].Name); + if (PlatformDetection.HasAssemblyFiles) + Assert.Equal(typeof(CustomAssemblyTests).Assembly.GetName().Name + ".dll", modules[0].Name); Assert.All(modules, (module) => Assert.Equal(ProjectionConstants.CustomModule, module.GetType().FullName)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))] public void GetModuleTest() { Module[] modules = _customAssembly.GetModules(true); @@ -112,6 +114,7 @@ public void GetModuleTest() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void GetSatelliteAssemblyTest() { Assert.Throws(() => _customAssembly.GetSatelliteAssembly(CultureInfo.InvariantCulture)); diff --git a/src/libraries/System.Reflection.Context/tests/CustomReflectionContextTests.cs b/src/libraries/System.Reflection.Context/tests/CustomReflectionContextTests.cs index f991ac5ab2246..18636bf7a034f 100644 --- a/src/libraries/System.Reflection.Context/tests/CustomReflectionContextTests.cs +++ b/src/libraries/System.Reflection.Context/tests/CustomReflectionContextTests.cs @@ -30,6 +30,7 @@ public void MapType_Null_Throws() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73356", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] [ActiveIssue("https://github.com/mono/mono/issues/15191", TestRuntimes.Mono)] public void MapType_MemberAttributes_Success() { @@ -45,6 +46,7 @@ public void MapType_MemberAttributes_Success() } [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73356", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] [ActiveIssue("https://github.com/mono/mono/issues/15191", TestRuntimes.Mono)] public void MapType_ParameterAttributes_Success() { diff --git a/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs b/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs index 47e6299b373e2..c06921cecc834 100644 --- a/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs +++ b/src/libraries/System.Resources.Extensions/tests/BinaryResourceWriterUnitTest.cs @@ -16,6 +16,8 @@ namespace System.Resources.Extensions.Tests { public class PreserializedResourceWriterTests { + public static bool AllowsCustomResourceTypes => AppContext.TryGetSwitch("System.Resources.ResourceManager.AllowCustomResourceTypes", out bool isEnabled) ? isEnabled : true; + [Fact] public static void ExceptionforNullStream() { @@ -339,7 +341,7 @@ public static void BinaryFormattedResourcesWithoutTypeName() } } } - [Fact] + [ConditionalFact(nameof(AllowsCustomResourceTypes))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34495", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] public static void TypeConverterByteArrayResources() { @@ -372,7 +374,7 @@ public static void TypeConverterByteArrayResources() } } - [Fact] + [ConditionalFact(nameof(AllowsCustomResourceTypes))] public static void TypeConverterStringResources() { var values = TestData.StringConverter; @@ -402,7 +404,7 @@ public static void TypeConverterStringResources() } } - [Fact] + [ConditionalFact(nameof(AllowsCustomResourceTypes))] [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 +470,7 @@ public static void CanReadViaResourceManager() } } - [Fact] + [ConditionalFact(nameof(AllowsCustomResourceTypes))] public static void ResourceManagerLoadsCorrectReader() { ResourceManager resourceManager = new ResourceManager(typeof(TestData)); diff --git a/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs b/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs index a7ab855896769..ebdac1cd0c48a 100644 --- a/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs +++ b/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs @@ -26,6 +26,8 @@ internal class TestClassWithoutNeutralResources public class ResourceManagerTests { + public static bool AllowsCustomResourceTypes => AppContext.TryGetSwitch("System.Resources.ResourceManager.AllowCustomResourceTypes", out bool isEnabled) ? isEnabled : true; + [Fact] public static void ExpectMissingManifestResourceException() { @@ -82,6 +84,7 @@ public static IEnumerable CultureResourceData() [Theory] [MemberData(nameof(CultureResourceData))] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] // satellite assemblies public static void GetString_CultureFallback(string key, string cultureName, string expectedValue) { Type resourceType = typeof(Resources.TestResx); @@ -92,6 +95,7 @@ public static void GetString_CultureFallback(string key, string cultureName, str } [Fact] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] //satellite assemblies public static void GetString_FromTestClassWithoutNeutralResources() { // This test is designed to complement the GetString_FromCulutureAndResourceType "fr" & "fr-CA" cases @@ -269,7 +273,7 @@ public static IEnumerable EnglishImageResourceData() yield return new object[] { "Icon", new Icon("icon.ico") }; } - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(nameof(IsDrawingSupportedAndAllowsCustomResourceTypes))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34008", TestPlatforms.Linux | TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [MemberData(nameof(EnglishImageResourceData))] public static void GetObject_Images(string key, object expectedValue) @@ -279,7 +283,7 @@ public static void GetObject_Images(string key, object expectedValue) Assert.Equal(GetImageData(expectedValue), GetImageData(manager.GetObject(key, new CultureInfo("en-US")))); } - [ConditionalTheory(Helpers.IsDrawingSupported)] + [ConditionalTheory(nameof(IsDrawingSupportedAndAllowsCustomResourceTypes))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34008", TestPlatforms.Linux | TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [MemberData(nameof(EnglishImageResourceData))] public static void GetObject_Images_ResourceSet(string key, object expectedValue) @@ -330,7 +334,9 @@ public static void GetResourceSet_NonStringsIgnoreCase(string key, object expect Assert.Equal(expectedValue, set.GetObject(key.ToLower(), true)); } - [ConditionalTheory(Helpers.IsDrawingSupported)] + public static bool IsDrawingSupportedAndAllowsCustomResourceTypes => PlatformDetection.IsDrawingSupported && AllowsCustomResourceTypes; + + [ConditionalTheory(nameof(IsDrawingSupportedAndAllowsCustomResourceTypes))] [ActiveIssue("https://github.com/dotnet/runtime/issues/34008", TestPlatforms.Linux | TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] [MemberData(nameof(EnglishImageResourceData))] public static void GetResourceSet_Images(string key, object expectedValue) diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/System.Security.Cryptography.Cng.Tests.csproj b/src/libraries/System.Security.Cryptography.Cng/tests/System.Security.Cryptography.Cng.Tests.csproj index 12d34c245d351..4bfc1719abf9d 100644 --- a/src/libraries/System.Security.Cryptography.Cng/tests/System.Security.Cryptography.Cng.Tests.csproj +++ b/src/libraries/System.Security.Cryptography.Cng/tests/System.Security.Cryptography.Cng.Tests.csproj @@ -3,6 +3,9 @@ $(DefineConstants);TESTING_CNG_IMPLEMENTATION $(NetCoreAppCurrent)-windows + + + diff --git a/src/libraries/System.Security.Cryptography.Cng/tests/default.rd.xml b/src/libraries/System.Security.Cryptography.Cng/tests/default.rd.xml new file mode 100644 index 0000000000000..932f3c37ec640 --- /dev/null +++ b/src/libraries/System.Security.Cryptography.Cng/tests/default.rd.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs index ac92a40e6d947..df5c022b9fcc9 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs @@ -885,7 +885,7 @@ public static void X509CertificateCollectionCopyTo() } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/57506", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoRuntime), nameof(PlatformDetection.IsMariner))] public static void X509ChainElementCollection_CopyTo_NonZeroLowerBound_ThrowsIndexOutOfRangeException() { @@ -914,7 +914,7 @@ public static void X509ChainElementCollection_CopyTo_NonZeroLowerBound_ThrowsInd } } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNonZeroLowerBoundArraySupported))] public static void X509ExtensionCollection_CopyTo_NonZeroLowerBound_ThrowsIndexOutOfRangeException() { using (X509Certificate2 cert = new X509Certificate2(TestData.PfxData, TestData.PfxDataPassword, Cert.EphemeralIfPossible)) diff --git a/src/libraries/System.Security.Cryptography/tests/CryptoConfigTests.cs b/src/libraries/System.Security.Cryptography/tests/CryptoConfigTests.cs index e59e1eae741d5..babea22f6cdaf 100644 --- a/src/libraries/System.Security.Cryptography/tests/CryptoConfigTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/CryptoConfigTests.cs @@ -39,7 +39,7 @@ public static void NamedCreateMethods_NullInput() // The returned types on .NET Framework can differ when the machine is in FIPS mode. // So check hash algorithms via a more complicated manner. - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] [ActiveIssue("https://github.com/dotnet/runtime/issues/37669", TestPlatforms.Browser)] [InlineData("MD5", typeof(MD5))] [InlineData("http://www.w3.org/2001/04/xmldsig-more#md5", typeof(MD5))] @@ -73,7 +73,7 @@ public static void NamedHashAlgorithmCreate(string identifier, Type baseType) } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] [ActiveIssue("https://github.com/dotnet/runtime/issues/37669", TestPlatforms.Browser)] [InlineData("System.Security.Cryptography.HMAC", typeof(HMACSHA1))] [InlineData("System.Security.Cryptography.KeyedHashAlgorithm", typeof(HMACSHA1))] @@ -134,7 +134,7 @@ public static IEnumerable NamedSymmetricAlgorithmCreateData } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] [MemberData(nameof(NamedSymmetricAlgorithmCreateData))] public static void NamedSymmetricAlgorithmCreate(string identifier, Type baseType) { @@ -145,7 +145,7 @@ public static void NamedSymmetricAlgorithmCreate(string identifier, Type baseTyp } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] [ActiveIssue("https://github.com/dotnet/runtime/issues/37669", TestPlatforms.Browser)] [InlineData("RSA", typeof(RSA))] [InlineData("System.Security.Cryptography.RSA", typeof(RSA))] @@ -159,7 +159,7 @@ public static void NamedAsymmetricAlgorithmCreate(string identifier, Type baseTy } } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] [ActiveIssue("https://github.com/dotnet/runtime/issues/37669", TestPlatforms.Browser)] [InlineData("DSA", typeof(DSA))] [InlineData("System.Security.Cryptography.DSA", typeof(DSA))] @@ -182,7 +182,7 @@ public static void NamedAsymmetricAlgorithmCreate_DSA_NotSupported(string identi Assert.Null(AsymmetricAlgorithm.Create(identifier)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] [ActiveIssue("https://github.com/dotnet/runtime/issues/37669", TestPlatforms.Browser)] public static void NamedCreate_Mismatch() { @@ -247,7 +247,7 @@ public static void AddOID_NullNames_Throws() AssertExtensions.Throws("names", () => CryptoConfig.AddOID(string.Empty, null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public static void AddAlgorithm_CreateFromName_ReturnsMapped() { @@ -295,7 +295,7 @@ public static void AddAlgorithm_NullNames_Throws() AssertExtensions.Throws("names", () => CryptoConfig.AddAlgorithm(typeof(CryptoConfigTests), null)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public static void StaticCreateMethods() { @@ -495,7 +495,8 @@ public static IEnumerable AllValidNames } } - [Theory, MemberData(nameof(AllValidNames))] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] + [MemberData(nameof(AllValidNames))] public static void CreateFromName_AllValidNames(string name, string typeName, bool supportsUnixMac) { bool isWindows = OperatingSystem.IsWindows(); diff --git a/src/libraries/System.Security.Cryptography/tests/PKCS1MaskGenerationMethodTest.cs b/src/libraries/System.Security.Cryptography/tests/PKCS1MaskGenerationMethodTest.cs index c388dc8c110f3..a57d3d9118a3d 100644 --- a/src/libraries/System.Security.Cryptography/tests/PKCS1MaskGenerationMethodTest.cs +++ b/src/libraries/System.Security.Cryptography/tests/PKCS1MaskGenerationMethodTest.cs @@ -27,6 +27,8 @@ namespace System.Security.Cryptography.Tests { + // PKCS1MaskGenerationMethod is annotated as RequiresUnreferencedCode + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] [SkipOnPlatform(TestPlatforms.Browser, "Not supported on Browser")] public class PKCS1MaskGenerationMethodTest { diff --git a/src/libraries/System.Security.Cryptography/tests/SignatureDescriptionTests.cs b/src/libraries/System.Security.Cryptography/tests/SignatureDescriptionTests.cs index 6568c373a4690..a1b346b8176ae 100644 --- a/src/libraries/System.Security.Cryptography/tests/SignatureDescriptionTests.cs +++ b/src/libraries/System.Security.Cryptography/tests/SignatureDescriptionTests.cs @@ -128,7 +128,7 @@ public void Deformatter() Assert.Throws(() => def = sig.CreateDeformatter(dsa)); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))] [PlatformSpecific(TestPlatforms.Windows)] // Operation is not supported on Unix public void Digest() { diff --git a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj index f2d2bc49a7f99..774292503608e 100644 --- a/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj +++ b/src/libraries/System.Security.Cryptography/tests/System.Security.Cryptography.Tests.csproj @@ -6,6 +6,9 @@ true true + + + $([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) diff --git a/src/libraries/System.Security.Cryptography/tests/default.rd.xml b/src/libraries/System.Security.Cryptography/tests/default.rd.xml new file mode 100644 index 0000000000000..932f3c37ec640 --- /dev/null +++ b/src/libraries/System.Security.Cryptography/tests/default.rd.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/libraries/System.Security.Permissions/tests/System.Security.Permissions.Tests.csproj b/src/libraries/System.Security.Permissions/tests/System.Security.Permissions.Tests.csproj index 3444a84274920..73f50b209fb16 100644 --- a/src/libraries/System.Security.Permissions/tests/System.Security.Permissions.Tests.csproj +++ b/src/libraries/System.Security.Permissions/tests/System.Security.Permissions.Tests.csproj @@ -4,6 +4,9 @@ $(NoWarn);SYSLIB0003 + + + diff --git a/src/libraries/System.Security.Permissions/tests/default.rd.xml b/src/libraries/System.Security.Permissions/tests/default.rd.xml new file mode 100644 index 0000000000000..65c55a63ed714 --- /dev/null +++ b/src/libraries/System.Security.Permissions/tests/default.rd.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs b/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs index e20f38e32be04..f746b48fdd5db 100644 --- a/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs +++ b/src/libraries/System.Threading.Channels/tests/ChannelTestBase.cs @@ -29,7 +29,7 @@ public abstract partial class ChannelTestBase : TestBase from b3 in new[] { false, true } select new object[] { b1, b2, b3 }; - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))] public void ValidateDebuggerAttributes() { Channel c = CreateChannel(); diff --git a/src/libraries/System.Threading.Channels/tests/DebugAttributeTests.cs b/src/libraries/System.Threading.Channels/tests/DebugAttributeTests.cs index bf0aab202473d..dcd007cfe2263 100644 --- a/src/libraries/System.Threading.Channels/tests/DebugAttributeTests.cs +++ b/src/libraries/System.Threading.Channels/tests/DebugAttributeTests.cs @@ -28,7 +28,7 @@ public static IEnumerable TestData() yield return new object[] { c3.Writer }; } - [Theory] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))] [MemberData(nameof(TestData))] public void TestDebuggerDisplaysAndTypeProxies(object obj) { @@ -36,7 +36,7 @@ public void TestDebuggerDisplaysAndTypeProxies(object obj) DebuggerAttributes.ValidateDebuggerTypeProxyProperties(obj); } - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))] public void TestDequeueClass() { var c = Channel.CreateBounded(10); diff --git a/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs b/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs index df0ddebf0afb3..336d8b3b755dc 100644 --- a/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs +++ b/src/libraries/System.Threading.Channels/tests/UnboundedChannelTests.cs @@ -173,7 +173,7 @@ public abstract class SingleReaderUnboundedChannelTests : UnboundedChannelTests { protected override bool RequiresSingleReader => true; - [Fact] + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))] public void ValidateInternalDebuggerAttributes() { Channel c = CreateChannel(); diff --git a/src/libraries/System.Threading.Overlapped/tests/OverlappedTests.cs b/src/libraries/System.Threading.Overlapped/tests/OverlappedTests.cs index 4468148eba692..e9838b6841e37 100644 --- a/src/libraries/System.Threading.Overlapped/tests/OverlappedTests.cs +++ b/src/libraries/System.Threading.Overlapped/tests/OverlappedTests.cs @@ -62,6 +62,7 @@ public static void PropertyTest2() [Fact] [ActiveIssue("https://github.com/mono/mono/issues/15311", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73422", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public static void PropertyTest3() { IAsyncResult asyncResult = new Task(() => Console.WriteLine("this is a dummy task")); diff --git a/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_AllocateNativeOverlappedTests.cs b/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_AllocateNativeOverlappedTests.cs index 5621e8a4f124e..e847086001c17 100644 --- a/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_AllocateNativeOverlappedTests.cs +++ b/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_AllocateNativeOverlappedTests.cs @@ -80,6 +80,7 @@ public unsafe void AllocateNativeOverlapped_EmptyArrayAsPinData_DoesNotThrow() [Fact] [PlatformSpecific(TestPlatforms.Windows)] // ThreadPoolBoundHandle.BindHandle is not supported on Unix + [ActiveIssue("https://github.com/dotnet/runtime/issues/73421", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public unsafe void AllocateNativeOverlapped_NonBlittableTypeAsPinData_Throws() { using (ThreadPoolBoundHandle handle = CreateThreadPoolBoundHandle()) @@ -129,6 +130,7 @@ public unsafe void AllocateNativeOverlapped_ObjectArrayAsPinData_DoesNotThrow() [Fact] [PlatformSpecific(TestPlatforms.Windows)] // ThreadPoolBoundHandle.BindHandle is not supported on Unix + [ActiveIssue("https://github.com/dotnet/runtime/issues/73421", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public unsafe void AllocateNativeOverlapped_ObjectArrayWithNonBlittableTypeAsPinData_Throws() { var array = new object[] diff --git a/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_PreAllocatedOverlappedTests.cs b/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_PreAllocatedOverlappedTests.cs index 8517a5c0a595a..22021bec4d83f 100644 --- a/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_PreAllocatedOverlappedTests.cs +++ b/src/libraries/System.Threading.Overlapped/tests/ThreadPoolBoundHandle_PreAllocatedOverlappedTests.cs @@ -43,6 +43,7 @@ public unsafe void PreAllocatedOverlapped_EmptyArrayAsPinData_DoesNotThrow() [Fact] [ActiveIssue("https://github.com/mono/mono/issues/15313", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73421", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public unsafe void PreAllocatedOverlapped_NonBlittableTypeAsPinData_Throws() { AssertExtensions.Throws(null, () => new PreAllocatedOverlapped((_, __, ___) => { }, new object(), new NonBlittableType() { s = "foo" })); @@ -75,6 +76,7 @@ public unsafe void PreAllocatedOverlapped_ObjectArrayAsPinData_DoesNotThrow() [Fact] [ActiveIssue("https://github.com/mono/mono/issues/15313", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73421", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public unsafe void PreAllocatedOverlapped_ObjectArrayWithNonBlittableTypeAsPinData_Throws() { var array = new object[] diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index e6b6a78289287..2d46d69750c30 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -462,6 +462,19 @@ + + + + + + + + + + + + + @@ -491,15 +504,6 @@ - - - - - - - - - @@ -529,23 +533,12 @@ - - - - - - - - - - -