Skip to content

Commit 9b7df13

Browse files
Merge pull request #1434 from SixLabors/js/macos-enable-tests
Enable resize tests on MacOs
2 parents f7ef221 + ecf05e2 commit 9b7df13

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,4 @@ artifacts/
221221
# Tests
222222
**/Images/ActualOutput
223223
**/Images/ReferenceOutput
224+
.DS_Store

tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public class ResizeTests
3535
nameof(KnownResamplers.Lanczos5),
3636
};
3737

38-
private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.07F);
38+
private static readonly ImageComparer ValidatorComparer =
39+
ImageComparer.TolerantPercentage(TestEnvironment.IsOSX && TestEnvironment.RunsOnCI ? 0.26F : 0.07F);
3940

4041
[Fact]
4142
public void Resize_PixelAgnostic()
@@ -355,7 +356,6 @@ public void Resize_WorksWithAllResamplers<TPixel>(
355356
}
356357

357358
[Theory]
358-
[PlatformSpecific(~TestPlatforms.OSX)]
359359
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
360360
public void ResizeFromSourceRectangle<TPixel>(TestImageProvider<TPixel> provider)
361361
where TPixel : unmanaged, IPixel<TPixel>
@@ -438,7 +438,6 @@ public void ResizeWidthCannotKeepAspectKeepsOnePixel<TPixel>(TestImageProvider<T
438438
}
439439

440440
[Theory]
441-
[PlatformSpecific(~TestPlatforms.OSX)]
442441
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
443442
public void ResizeWithBoxPadMode<TPixel>(TestImageProvider<TPixel> provider)
444443
where TPixel : unmanaged, IPixel<TPixel>
@@ -549,7 +548,6 @@ public void ResizeWithMinMode<TPixel>(TestImageProvider<TPixel> provider)
549548
}
550549

551550
[Theory]
552-
[PlatformSpecific(~TestPlatforms.OSX)]
553551
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
554552
public void ResizeWithPadMode<TPixel>(TestImageProvider<TPixel> provider)
555553
where TPixel : unmanaged, IPixel<TPixel>

tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ internal static string GetReferenceOutputFileName(string actualOutputFileName) =
108108

109109
internal static bool IsLinux => RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
110110

111+
internal static bool IsOSX => RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
112+
111113
internal static bool IsMono => Type.GetType("Mono.Runtime") != null; // https://stackoverflow.com/a/721194
112114

113115
internal static bool IsWindows => RuntimeInformation.IsOSPlatform(OSPlatform.Windows);

0 commit comments

Comments
 (0)