* MetadataLoadContext tests need more work for single file testing in general. Filed a separate issue.
* S.R.Intrinsics is now clean. Running it on NativeAOT found good JIT bugs (#72081, #72158). Promoting to a smoke test.
* S.Drawing.Primitives was testing DataContractSerializer for whatever reason. Marked that as aggresive trimming incompatible. This wouldn't be covered by #72910.
* Made S.R.InteropServices.ComDisabled fully pass by fixing exceptions we throw.
* A couple tests won't ever make sense to run on NativeAOT so removed them from triage area.
isSingleFile: true
nameSuffix: NativeAOT_Libs_Passing
buildArgs: -s clr.aot+libs+libs.tests -c $(_BuildConfig) /p:TestNativeAot=true /p:ArchiveTests=true
- timeoutInMinutes: 180
+ timeoutInMinutes: 240
# extra steps, run tests
extraStepsTemplate: /eng/pipelines/libraries/helix.yml
extraStepsParameters:
{
if (s_globalInstanceForMarshalling == null)
{
- throw new InvalidOperationException(SR.InvalidOperation_ComInteropRequireComWrapperInstance);
+ throw new NotSupportedException(SR.InvalidOperation_ComInteropRequireComWrapperInstance);
}
return s_globalInstanceForMarshalling.GetOrCreateComInterfaceForObject(instance, CreateComInterfaceFlags.None);
{
if (s_globalInstanceForMarshalling == null)
{
- throw new InvalidOperationException(SR.InvalidOperation_ComInteropRequireComWrapperInstance);
+ throw new NotSupportedException(SR.InvalidOperation_ComInteropRequireComWrapperInstance);
}
return s_globalInstanceForMarshalling.GetOrCreateObjectForComInstance(externalComObject, CreateObjectFlags.Unwrap);
[EditorBrowsable(EditorBrowsableState.Never)]
public static IntPtr CreateAggregatedObject(IntPtr pOuter, object o)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[RequiresUnreferencedCode("Built-in COM support is not trim compatible", Url = "https://aka.ms/dotnet-illink/com")]
[SupportedOSPlatform("windows")]
public static object BindToMoniker(string monikerName)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
public static void CleanupUnusedObjectsInCurrentContext()
[SupportedOSPlatform("windows")]
public static IntPtr CreateAggregatedObject<T>(IntPtr pOuter, T o) where T : notnull
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static object? CreateWrapperOfType(object? o, Type t)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
public static TWrapper CreateWrapperOfType<T, TWrapper>(T? o)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
public static void ChangeWrapperHandleStrength(object otp, bool fIsWeak)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
public static int FinalReleaseComObject(object o)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static IntPtr GetComInterfaceForObject(object o, Type T, CustomQueryInterfaceMode mode)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("windows")]
public static object? GetComObjectData(object obj, object key)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("windows")]
public static object GetTypedObjectForIUnknown(IntPtr pUnk, Type t)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static T GetObjectForNativeVariant<T>(IntPtr pSrcNativeVariant)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static object?[] GetObjectsForNativeVariants(IntPtr aSrcNativeVariant, int cVars)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
[EditorBrowsable(EditorBrowsableState.Never)]
public static T[] GetObjectsForNativeVariants<T>(IntPtr aSrcNativeVariant, int cVars)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
public static int GetStartComSlot(Type t)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
public static int GetEndComSlot(Type t)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
internal static Type? GetTypeFromCLSID(Guid clsid, string? server, bool throwOnError)
[SupportedOSPlatform("windows")]
public static string GetTypeInfoName(ITypeInfo typeInfo)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
public static object GetUniqueObjectForIUnknown(IntPtr unknown)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
public static bool IsComObject(object o)
[SupportedOSPlatform("windows")]
public static int ReleaseComObject(object o)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
[SupportedOSPlatform("windows")]
public static bool SetComObjectData(object obj, object key, object? data)
{
- throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+ throw new NotSupportedException(SR.PlatformNotSupported_ComInterop);
}
}
}
Assert.Equal(!expected, right != left);
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsDebuggerTypeProxyAttributeSupported))]
public void DebuggerAttributesAreValid()
{
DebuggerAttributes.ValidateDebuggerDisplayReferences(Color.Aquamarine);
namespace System.Drawing.Primitives.Tests
{
+ [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBuiltWithAggressiveTrimming))]
public class DataContractSerializerTests
{
[Fact]
public partial class MarshalComDisabledTests
{
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/72914", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))]
public void GetTypeFromCLSID_ThrowsNotSupportedException()
{
Assert.Throws<NotSupportedException>(() => Marshal.GetTypeFromCLSID(Guid.Empty));
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/72911", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))]
public void GetNativeVariantForObject_ThrowsNotSupportedException()
{
Assert.Throws<NotSupportedException>(() => Marshal.GetNativeVariantForObject(99, IntPtr.Zero));
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/72911", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))]
public void GetNativeVariantForObject_T_ThrowsNotSupportedException()
{
Assert.Throws<NotSupportedException>(() => Marshal.GetNativeVariantForObject<double>(99, IntPtr.Zero));
public struct NativeVariant{}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/72911", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))]
public void GetObjectForNativeVariant_ThrowsNotSupportedException()
{
NativeVariant variant = new NativeVariant();
public struct NativeVariant_T{}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/72911", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))]
public void GetObjectForNativeVariant_T_ThrowsNotSupportedException()
{
NativeVariant_T variant = new NativeVariant_T();
</ItemGroup>
<ItemGroup Condition="'$(TestNativeAot)' == 'true' and '$(RunDisabledNativeAotTests)' != 'true'">
+ <!-- https://github.com/dotnet/runtime/issues/72908 -->
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.MetadataLoadContext\tests\System.Reflection.MetadataLoadContext.Tests.csproj" />
+
+ <!-- Not applicable to NativeAOT -->
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection\tests\InvokeEmit\System.Reflection.InvokeEmit.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection\tests\InvokeInterpreted\System.Reflection.InvokeInterpreted.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System\Reflection\InvokeEmit\System.Runtime.ReflectionInvokeEmit.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System\Reflection\InvokeInterpreted\System.Runtime.ReflectionInvokeInterpreted.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Loader\tests\DefaultContext\System.Runtime.Loader.DefaultContext.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Loader\tests\RefEmitLoadContext\System.Runtime.Loader.RefEmitLoadContext.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Loader\tests\System.Runtime.Loader.Tests.csproj" />
+ <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection\tests\CoreCLR\System.Reflection.CoreCLR.Tests.csproj" />
<!-- Most of these need tagging as "requires Ref.Emit". Not much interesting things left to run. Low priority. -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.Emit.Lightweight\tests\System.Reflection.Emit.Lightweight.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.Emit.ILGeneration\tests\System.Reflection.Emit.ILGeneration.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.Emit\tests\System.Reflection.Emit.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Loader\tests\System.Runtime.Loader.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.DispatchProxy\tests\System.Reflection.DispatchProxy.Tests.csproj" />
<!-- Not compatible with trimming in general. Low priority -->
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.NetworkInformation\tests\FunctionalTests\System.Net.NetworkInformation.Functional.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Net.Sockets\tests\FunctionalTests\System.Net.Sockets.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.InteropServices\tests\System.Runtime.InteropServices.UnitTests\System.Runtime.InteropServices.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Intrinsics\tests\System.Runtime.Intrinsics.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Linq.Parallel\tests\System.Linq.Parallel.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn3.11.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Text.Json\tests\System.Text.Json.SourceGeneration.Tests\System.Text.Json.SourceGeneration.Roslyn4.0.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.DirectoryServices\tests\System.DirectoryServices.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.DirectoryServices.AccountManagement\tests\System.DirectoryServices.AccountManagement.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.DirectoryServices.Protocols\tests\System.DirectoryServices.Protocols.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Drawing.Primitives\tests\System.Drawing.Primitives.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Dynamic.Runtime\tests\System.Dynamic.Runtime.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Formats.Cbor\tests\System.Formats.Cbor.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Globalization\tests\NlsTests\System.Globalization.Nls.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Private.Xml\tests\XmlSerializer\ReflectionOnly\System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Private.Xml\tests\Xslt\XslCompiledTransformApi\System.Xml.Xsl.XslCompiledTransformApi.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Private.Xml\tests\Xslt\XsltCompiler\XsltCompiler.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection\tests\CoreCLR\System.Reflection.CoreCLR.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.Context\tests\System.Reflection.Context.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.Extensions\tests\System.Reflection.Extensions.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.TypeExtensions\tests\System.Reflection.TypeExtensions.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Resources.ResourceManager\tests\System.Resources.ResourceManager.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\NlsTests\System.Runtime.Nls.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Extensions\tests\System.Runtime.Extensions.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.InteropServices\tests\System.Runtime.InteropServices.ComDisabled.UnitTests\System.Runtime.InteropServices.ComDisabled.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.InteropServices.RuntimeInformation\tests\System.Runtime.InteropServices.RuntimeInformation.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Loader\tests\DefaultContext\System.Runtime.Loader.DefaultContext.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Loader\tests\RefEmitLoadContext\System.Runtime.Loader.RefEmitLoadContext.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Serialization.Formatters\tests\System.Runtime.Serialization.Formatters.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Serialization.Json\tests\System.Runtime.Serialization.Json.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime.Serialization.Json\tests\ReflectionOnly\System.Runtime.Serialization.Json.ReflectionOnly.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading.Channels\tests\System.Threading.Channels.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading.Overlapped\tests\System.Threading.Overlapped.Tests.csproj" />
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Threading.Tasks.Dataflow\tests\System.Threading.Tasks.Dataflow.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection\tests\InvokeEmit\System.Reflection.InvokeEmit.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection\tests\InvokeInterpreted\System.Reflection.InvokeInterpreted.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System\Reflection\InvokeEmit\System.Runtime.ReflectionInvokeEmit.Tests.csproj" />
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System\Reflection\InvokeInterpreted\System.Runtime.ReflectionInvokeInterpreted.Tests.csproj" />
- <!--These tests don't build-->
- <ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.MetadataLoadContext\tests\System.Reflection.MetadataLoadContext.Tests.csproj" />
</ItemGroup>
<ItemGroup>
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Collections\tests\System.Collections.Tests.csproj" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Reflection\tests\System.Reflection.Tests.csproj" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Runtime\tests\System.Runtime.Tests.csproj" />
+ <SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Runtime.Intrinsics\tests\System.Runtime.Intrinsics.Tests.csproj" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.IO.Compression\tests\System.IO.Compression.Tests.csproj" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.IO.FileSystem\tests\System.IO.FileSystem.Tests.csproj" />
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Threading\tests\System.Threading.Tests.csproj" />
CaptureComPointer(target);
throw new Exception("Cannot work without ComWrappers.RegisterForMarshalling called");
}
- catch (InvalidOperationException)
+ catch (NotSupportedException)
{
}
}