Skip to content

Commit

Permalink
Merge pull request #1434 from SixLabors/js/macos-enable-tests
Browse files Browse the repository at this point in the history
Enable resize tests on MacOs
  • Loading branch information
JimBobSquarePants authored Nov 22, 2020
2 parents f7ef221 + ecf05e2 commit 9b7df13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,4 @@ artifacts/
# Tests
**/Images/ActualOutput
**/Images/ReferenceOutput
.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -355,7 +356,6 @@ public void Resize_WorksWithAllResamplers<TPixel>(
}

[Theory]
[PlatformSpecific(~TestPlatforms.OSX)]
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
public void ResizeFromSourceRectangle<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
Expand Down Expand Up @@ -438,7 +438,6 @@ public void ResizeWidthCannotKeepAspectKeepsOnePixel<TPixel>(TestImageProvider<T
}

[Theory]
[PlatformSpecific(~TestPlatforms.OSX)]
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
public void ResizeWithBoxPadMode<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
Expand Down Expand Up @@ -549,7 +548,6 @@ public void ResizeWithMinMode<TPixel>(TestImageProvider<TPixel> provider)
}

[Theory]
[PlatformSpecific(~TestPlatforms.OSX)]
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
public void ResizeWithPadMode<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
Expand Down
2 changes: 2 additions & 0 deletions tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9b7df13

Please sign in to comment.