diff --git a/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs b/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs index 161350299f..f7afa5d15b 100644 --- a/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs +++ b/tests/ImageSharp.Tests.ProfilingSandbox/Program.cs @@ -4,6 +4,7 @@ using SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations; using SixLabors.ImageSharp.Tests.ProfilingBenchmarks; using SixLabors.ImageSharp.Tests.ProfilingSandbox; +using Xunit; // in this file, comments are used for disabling stuff for local execution #pragma warning disable SA1515 @@ -31,7 +32,12 @@ static void RunToVector4ProfilingTest() sealed class ConsoleOutput : ITestOutputHelper { + public void Write(string message) => Console.Write(message); + + public void Write(string format, params object[] args) => Console.Write(format, args); + public void WriteLine(string message) => Console.WriteLine(message); public void WriteLine(string format, params object[] args) => Console.WriteLine(format, args); + public string Output { get; } } diff --git a/tests/ImageSharp.Tests/Image/ImageTests.Decode_Cancellation.cs b/tests/ImageSharp.Tests/Image/ImageTests.Decode_Cancellation.cs index cf6b2ba228..06ce7fd634 100644 --- a/tests/ImageSharp.Tests/Image/ImageTests.Decode_Cancellation.cs +++ b/tests/ImageSharp.Tests/Image/ImageTests.Decode_Cancellation.cs @@ -58,7 +58,7 @@ public partial class ImageTests public static TheoryData LoadData { get; } = CreateLoadData(); // TODO: Figure out cancellation failures on Linux - [Theory(SkipType = typeof(TestEnvironment), SkipUnless = nameof(TestEnvironment.IsWindows))] + [Theory(Skip = "Skipped on non-Windows platforms", SkipType = typeof(TestEnvironment), SkipUnless = nameof(TestEnvironment.IsWindows))] [MemberData(nameof(LoadData))] public async Task LoadAsync_IsCancellable(bool useMemoryStream, string file, double percentageOfStreamReadToCancel) { diff --git a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs index 27cf40df1b..fbb12babdf 100644 --- a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs +++ b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs @@ -57,7 +57,7 @@ public partial class UniformUnmanagedMemoryPoolTests // TODO: Investigate failures on macOS. All handles are released after GC. // (It seems to happen more consistently on .NET 6.) - [Fact(SkipUnless = nameof(IsNotMacOS))] + [Fact(Skip = "Skipped on macOS", SkipUnless = nameof(IsNotMacOS))] public void MultiplePoolInstances_TrimPeriodElapsed_AllAreTrimmed() { if (!TestEnvironment.RunsOnCI) diff --git a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs index 5489bc7e5d..3c4472bc9d 100644 --- a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs +++ b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs @@ -240,7 +240,7 @@ public partial class UniformUnmanagedMemoryPoolTests public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS; // TODO: Investigate macOS failures - [Theory(SkipUnless = nameof(IsNotMacOS))] + [Theory(Skip = "Skipped on macOS", SkipUnless = nameof(IsNotMacOS))] [InlineData(false)] [InlineData(true)] public void RentReturnRelease_SubsequentRentReturnsDifferentHandles(bool multiple) diff --git a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs index bb0597728b..887b266856 100644 --- a/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs +++ b/tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs @@ -584,7 +584,7 @@ public class UniformUnmanagedPoolMemoryAllocatorTests } } - [Fact(SkipType = typeof(Environment), SkipUnless = nameof(Environment.Is64BitProcess))] + [Fact(Skip = "Requires 64-bit process", SkipType = typeof(Environment), SkipUnless = nameof(Environment.Is64BitProcess))] public void MemoryAllocator_Create_SetHighLimit() { RemoteExecutor.Invoke(RunTest).Dispose(); diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs index 0b5fd70d90..3089c5f028 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs @@ -71,11 +71,14 @@ public abstract class ImageDataAttributeBase : DataAttribute object obj = accessor(); if (obj is IEnumerable memberItems) { - addedRows = memberItems.Select(x => x as object[]); - if (addedRows.Any(x => x == null)) + // In xunit.v3, TheoryData yields ITheoryDataRow, not object[]. + // Call GetData() to unpack the row's values. + addedRows = memberItems.Select(x => { - addedRows = memberItems.Select(x => new[] { x }); - } + if (x is ITheoryDataRow row) return row.GetData(); + if (x is object[] arr) return arr; + return new[] { x }; + }); } } } diff --git a/tests/ImageSharp.Tests/TestUtilities/SixLaborsXunitTestFramework.cs b/tests/ImageSharp.Tests/TestUtilities/SixLaborsXunitTestFramework.cs index 0dc37d533f..964b7c486e 100644 --- a/tests/ImageSharp.Tests/TestUtilities/SixLaborsXunitTestFramework.cs +++ b/tests/ImageSharp.Tests/TestUtilities/SixLaborsXunitTestFramework.cs @@ -13,6 +13,6 @@ public class SixLaborsXunitTestFramework : XunitTestFramework { public SixLaborsXunitTestFramework() { - Console.WriteLine(HostEnvironmentInfo.GetInformation()); + Console.Error.WriteLine(HostEnvironmentInfo.GetInformation()); } } diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs index 1ac9100574..90bd8f939b 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs @@ -120,7 +120,7 @@ public class TestEnvironmentTests // https://github.com/SixLabors/ImageSharp/blob/381dff8640b721a34b1227c970fcf6ad6c5e3e72/ci-test.ps1#L30 public static bool IsNot32BitNetFramework = !TestEnvironment.IsFramework || TestEnvironment.Is64BitProcess; - [Fact(SkipUnless = nameof(IsNot32BitNetFramework))] + [Fact(Skip = "Not supported on 32-bit .NET Framework", SkipUnless = nameof(IsNot32BitNetFramework))] public void RemoteExecutor_FailingRemoteTestShouldFailLocalTest() { static void FailingCode()