Browse Source

Merge pull request #1434 from SixLabors/js/macos-enable-tests

Enable resize tests on MacOs
js/color-alpha-handling
James Jackson-South 6 years ago
committed by GitHub
parent
commit
275f12f5c6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 6
      tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs
  3. 2
      tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs

1
.gitignore

@ -221,3 +221,4 @@ artifacts/
# Tests
**/Images/ActualOutput
**/Images/ReferenceOutput
.DS_Store

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

@ -35,7 +35,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
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 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
}
[Theory]
[PlatformSpecific(~TestPlatforms.OSX)]
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
public void ResizeFromSourceRectangle<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
@ -438,7 +438,6 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
}
[Theory]
[PlatformSpecific(~TestPlatforms.OSX)]
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
public void ResizeWithBoxPadMode<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
@ -549,7 +548,6 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
}
[Theory]
[PlatformSpecific(~TestPlatforms.OSX)]
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
public void ResizeWithPadMode<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>

2
tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs

@ -108,6 +108,8 @@ namespace SixLabors.ImageSharp.Tests
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);

Loading…
Cancel
Save