From 16b81ada56ece1d0a9bed144d98824ea500de54b Mon Sep 17 00:00:00 2001 From: Max Katz Date: Thu, 15 Aug 2024 15:53:53 -0700 Subject: [PATCH] Disable DelegateTypesAreValid and DelegateTypesHaveAttributes tests on .NET 7+ build, see comments --- tests/Tests/ApiTests.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Tests/ApiTests.cs b/tests/Tests/ApiTests.cs index 9b6f4dcf7f..114aac3cee 100644 --- a/tests/Tests/ApiTests.cs +++ b/tests/Tests/ApiTests.cs @@ -56,6 +56,8 @@ public class ApiTest : BaseTest public static IEnumerable InteropDelegatesData => InteropDelegates.Select(m => new object[] { m }); + // Targets using USE_LIBRARY_IMPORT don't have delegates generated as they are not used. +#if !USE_LIBRARY_IMPORT [Trait(Traits.Category.Key, Traits.Category.Values.Api)] [SkippableFact] public void DelegateTypesAreValid() @@ -71,6 +73,7 @@ public void DelegateTypesHaveAttributes(Type delegateType) { Assert.NotNull(delegateType.GetCustomAttribute()); } +#endif [Trait(Traits.Category.Key, Traits.Category.Values.Api)] [SkippableTheory]