Browse Source

Remove mac specific skips

pull/2384/head
Stefan Nikolei 3 years ago
parent
commit
b661c07744
  1. 98
      tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs
  2. 5
      tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs
  3. 4
      tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs
  4. 40
      tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs
  5. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs

98
tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs

@ -202,13 +202,13 @@ public class TiffDecoderTests : TiffDecoderBaseTester
public void TiffDecoder_CanDecode_12Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }
TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.264F);
}
@ -258,13 +258,13 @@ public class TiffDecoderTests : TiffDecoderBaseTester
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }
TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.376F);
}
@ -284,13 +284,13 @@ public class TiffDecoderTests : TiffDecoderBaseTester
public void TiffDecoder_CanDecode_24Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }
TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.405F);
}
@ -385,13 +385,13 @@ public class TiffDecoderTests : TiffDecoderBaseTester
public void TiffDecoder_CanDecode_32Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }
// Note: Using tolerant comparer here, because there is a small difference to the reference decoder probably due to floating point rounding issues.
TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.004F);
@ -425,13 +425,13 @@ public class TiffDecoderTests : TiffDecoderBaseTester
public void TiffDecoder_CanDecode_40Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }
TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.247F);
}
@ -463,13 +463,13 @@ public class TiffDecoderTests : TiffDecoderBaseTester
public void TiffDecoder_CanDecode_48Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }
TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.118F);
}
@ -492,13 +492,13 @@ public class TiffDecoderTests : TiffDecoderBaseTester
public void TiffDecoder_CanDecode_56Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
image.DebugSave(provider);
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
// using Image<TPixel> image = provider.GetImage(TiffDecoder.Instance);
// image.DebugSave(provider);
// return;
// }
TestTiffDecoder(provider, useExactComparer: false, compareTolerance: 0.075F);
}

5
tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs

@ -53,11 +53,12 @@ public partial class UniformUnmanagedMemoryPoolTests
[Collection(nameof(NonParallelCollection))]
public class NonParallel
{
public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS;
// public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS;
// TODO: Investigate failures on macOS. All handles are released after GC.
// (It seems to happen more consistently on .NET 6.)
[ConditionalFact(nameof(IsNotMacOS))]
// [ConditionalFact(nameof(IsNotMacOS))]
[Fact]
public void MultiplePoolInstances_TrimPeriodElapsed_AllAreTrimmed()
{
if (!TestEnvironment.RunsOnCI)

4
tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs

@ -238,10 +238,10 @@ public partial class UniformUnmanagedMemoryPoolTests
cleanup.Register(b1);
}
public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS;
// public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS;
// TODO: Investigate macOS failures
[ConditionalTheory(nameof(IsNotMacOS))]
// [ConditionalTheory(nameof(IsNotMacOS))]
[InlineData(false)]
[InlineData(true)]
public void RentReturnRelease_SubsequentRentReturnsDifferentHandles(bool multiple)

40
tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs

@ -255,11 +255,11 @@ public class UniformUnmanagedPoolMemoryAllocatorTests
[InlineData(1200)] // Group of two UniformUnmanagedMemoryPool buffers
public void AllocateMemoryGroup_Finalization_ReturnsToPool(int length)
{
if (TestEnvironment.IsMacOS)
{
// Skip on macOS: https://github.com/SixLabors/ImageSharp/issues/1887
return;
}
// if (TestEnvironment.IsMacOS)
// {
// // Skip on macOS: https://github.com/SixLabors/ImageSharp/issues/1887
// return;
// }
if (TestEnvironment.OSArchitecture == Architecture.Arm64)
{
@ -267,12 +267,12 @@ public class UniformUnmanagedPoolMemoryAllocatorTests
return;
}
if (!TestEnvironment.RunsOnCI)
{
// This may fail in local runs resulting in high memory load.
// Remove the condition for local debugging!
return;
}
// if (!TestEnvironment.RunsOnCI)
// {
// // This may fail in local runs resulting in high memory load.
// // Remove the condition for local debugging!
// return;
// }
// RunTest(length.ToString());
RemoteExecutor.Invoke(RunTest, length.ToString()).Dispose();
@ -323,24 +323,18 @@ public class UniformUnmanagedPoolMemoryAllocatorTests
[InlineData(600)] // Group of single UniformUnmanagedMemoryPool buffer
public void AllocateSingleMemoryOwner_Finalization_ReturnsToPool(int length)
{
if (TestEnvironment.IsMacOS)
{
// Skip on macOS: https://github.com/SixLabors/ImageSharp/issues/1887
return;
}
if (TestEnvironment.OSArchitecture == Architecture.Arm64)
{
// Skip on ARM64: https://github.com/SixLabors/ImageSharp/issues/2342
return;
}
if (!TestEnvironment.RunsOnCI)
{
// This may fail in local runs resulting in high memory load.
// Remove the condition for local debugging!
return;
}
// if (!TestEnvironment.RunsOnCI)
// {
// // This may fail in local runs resulting in high memory load.
// // Remove the condition for local debugging!
// return;
// }
// RunTest(length.ToString());
RemoteExecutor.Invoke(RunTest, length.ToString()).Dispose();

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

@ -31,7 +31,7 @@ public class ResizeTests
};
private static readonly ImageComparer ValidatorComparer =
ImageComparer.TolerantPercentage(TestEnvironment.IsMacOS && TestEnvironment.RunsOnCI ? 0.26F : 0.07F);
ImageComparer.TolerantPercentage(0.07F);
[Fact]
public void Resize_PixelAgnostic()

Loading…
Cancel
Save