diff --git a/.gitignore b/.gitignore index a89cfcf104..475d6e76b0 100644 --- a/.gitignore +++ b/.gitignore @@ -221,3 +221,4 @@ artifacts/ # Tests **/Images/ActualOutput **/Images/ReferenceOutput +.DS_Store diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs index 47d951837d..4a20f4e568 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs @@ -35,7 +35,8 @@ public class ResizeTests nameof(KnownResamplers.Lanczos5), }; - private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.07F); + private static readonly ImageComparer ValidatorComparer = + ImageComparer.TolerantPercentage(TestEnvironment.IsOSX && TestEnvironment.RunsOnCI ? 0.26F : 0.07F); [Fact] public void Resize_PixelAgnostic() @@ -355,7 +356,6 @@ public void Resize_WorksWithAllResamplers( } [Theory] - [PlatformSpecific(~TestPlatforms.OSX)] [WithFileCollection(nameof(CommonTestImages), DefaultPixelType)] public void ResizeFromSourceRectangle(TestImageProvider provider) where TPixel : unmanaged, IPixel @@ -438,7 +438,6 @@ public void ResizeWidthCannotKeepAspectKeepsOnePixel(TestImageProvider(TestImageProvider provider) where TPixel : unmanaged, IPixel @@ -549,7 +548,6 @@ public void ResizeWithMinMode(TestImageProvider provider) } [Theory] - [PlatformSpecific(~TestPlatforms.OSX)] [WithFileCollection(nameof(CommonTestImages), DefaultPixelType)] public void ResizeWithPadMode(TestImageProvider provider) where TPixel : unmanaged, IPixel diff --git a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs index 48728faf0e..b80a29646c 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs @@ -108,6 +108,8 @@ internal static string GetReferenceOutputFileName(string actualOutputFileName) = internal static bool IsLinux => RuntimeInformation.IsOSPlatform(OSPlatform.Linux); + internal static bool IsOSX => RuntimeInformation.IsOSPlatform(OSPlatform.OSX); + internal static bool IsMono => Type.GetType("Mono.Runtime") != null; // https://stackoverflow.com/a/721194 internal static bool IsWindows => RuntimeInformation.IsOSPlatform(OSPlatform.Windows);