Skip to content

Commit

Permalink
Merge pull request #1455 from SixLabors/bp/xunittraits
Browse files Browse the repository at this point in the history
Add xunit trait attributes to tests
  • Loading branch information
brianpopow authored Dec 3, 2020
2 parents 14c541c + 455088e commit 5ab768c
Show file tree
Hide file tree
Showing 83 changed files with 125 additions and 44 deletions.
7 changes: 4 additions & 3 deletions tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@

using SixLabors.ImageSharp.Formats.Bmp;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.TestUtilities;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
using SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs;

using Xunit;

using static SixLabors.ImageSharp.Tests.TestImages.Bmp;

// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Bmp
{
using SixLabors.ImageSharp.Metadata;
using static TestImages.Bmp;

[Trait("Format", "Bmp")]
public class BmpDecoderTests
{
public const PixelTypes CommonNonDefaultPixelTypes = PixelTypes.Rgba32 | PixelTypes.Bgra32 | PixelTypes.RgbaVector;
Expand Down
6 changes: 4 additions & 2 deletions tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@
using SixLabors.ImageSharp.Processing.Processors.Quantization;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
using SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs;

using Xunit;
using Xunit.Abstractions;

using static SixLabors.ImageSharp.Tests.TestImages.Bmp;

// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Bmp
{
using static TestImages.Bmp;

[Trait("Format", "Bmp")]
public class BmpEncoderTests
{
public static readonly TheoryData<BmpBitsPerPixel> BitsPerPixel =
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Bmp/BmpFileHeaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Bmp
{
[Trait("Format", "Bmp")]
public class BmpFileHeaderTests
{
[Fact]
Expand Down
6 changes: 4 additions & 2 deletions tests/ImageSharp.Tests/Formats/Bmp/BmpMetadataTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
using System.IO;

using SixLabors.ImageSharp.Formats.Bmp;

using Xunit;

using static SixLabors.ImageSharp.Tests.TestImages.Bmp;

// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Bmp
{
using static TestImages.Bmp;

[Trait("Format", "Bmp")]
public class BmpMetadataTests
{
[Fact]
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Gif
{
[Trait("Format", "Gif")]
public class GifDecoderTests
{
private const PixelTypes TestPixelTypes = PixelTypes.Rgba32 | PixelTypes.RgbaVector | PixelTypes.Argb32;
Expand Down
4 changes: 3 additions & 1 deletion tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
// Licensed under the Apache License, Version 2.0.

using System.IO;
using SixLabors.ImageSharp.Formats;

using SixLabors.ImageSharp.Formats.Gif;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing.Processors.Quantization;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;

using Xunit;

// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Gif
{
[Trait("Format", "Gif")]
public class GifEncoderTests
{
private const PixelTypes TestPixelTypes = PixelTypes.Rgba32 | PixelTypes.RgbaVector | PixelTypes.Argb32;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Gif
{
[Trait("Format", "Gif")]
public class GifFrameMetadataTests
{
[Fact]
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Gif/GifMetadataTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Gif
{
[Trait("Format", "Gif")]
public class GifMetadataTests
{
public static readonly TheoryData<string, int, int, PixelResolutionUnit> RatioFiles =
Expand Down
5 changes: 3 additions & 2 deletions tests/ImageSharp.Tests/Formats/Jpg/AdobeMarkerTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.

using SixLabors.ImageSharp.Formats.Jpeg;
Expand All @@ -8,6 +8,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class AdobeMarkerTests
{
// Taken from actual test image
Expand Down Expand Up @@ -79,4 +80,4 @@ public void MarkerHashCodeIsUnique()
Assert.False(marker.GetHashCode().Equals(marker2.GetHashCode()));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public partial class Block8x8FTests
{
public class CopyToBufferArea : JpegFixture
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public partial class Block8x8FTests : JpegFixture
{
#if BENCHMARKING
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Jpg/Block8x8Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class Block8x8Tests : JpegFixture
{
public Block8x8Tests(ITestOutputHelper output)
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public static class DCTTests
{
public class FastFloatingPoint : JpegFixture
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Jpg/GenericBlock8x8Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class GenericBlock8x8Tests
{
public static Image<TPixel> CreateTestImage<TPixel>()
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Jpg/ImageExtensionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class ImageExtensionsTest
{
[Fact]
Expand Down
5 changes: 3 additions & 2 deletions tests/ImageSharp.Tests/Formats/Jpg/JFifMarkerTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.

using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder;
Expand All @@ -7,6 +7,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class JFifMarkerTests
{
// Taken from actual test image
Expand Down Expand Up @@ -91,4 +92,4 @@ public void MarkerHashCodeIsUnique()
Assert.False(marker.GetHashCode().Equals(marker2.GetHashCode()));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class JpegColorConverterTests
{
private const float Precision = 0.1F / 255;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.

using Microsoft.DotNet.RemoteExecutor;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.TestUtilities;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;

using Xunit;

// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public partial class JpegDecoderTests
{
[Theory]
Expand Down
2 changes: 2 additions & 0 deletions tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Images.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// Licensed under the Apache License, Version 2.0.

using System.Collections.Generic;
using Xunit;

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public partial class JpegDecoderTests
{
public static string[] BaselineTestJpegs =
Expand Down
13 changes: 7 additions & 6 deletions tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Metadata.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.

using System;
using System.IO;
using System.Runtime.CompilerServices;

using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.Metadata.Profiles.Exif;
using SixLabors.ImageSharp.Metadata.Profiles.Icc;
using SixLabors.ImageSharp.PixelFormats;

using Xunit;

// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
using System;
using System.Runtime.CompilerServices;

using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.Metadata;

[Trait("Format", "Jpg")]
public partial class JpegDecoderTests
{
// TODO: A JPEGsnoop & metadata expert should review if the Exif/Icc expectations are correct.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public partial class JpegDecoderTests
{
public const string DecodeProgressiveJpegOutputName = "DecodeProgressiveJpeg";
Expand Down
4 changes: 2 additions & 2 deletions tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.DotNet.RemoteExecutor;

using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.IO;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
using SixLabors.ImageSharp.Tests.TestUtilities;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;

using Xunit;
Expand All @@ -22,6 +21,7 @@
namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
// TODO: Scatter test cases into multiple test classes
[Trait("Format", "Jpg")]
public partial class JpegDecoderTests
{
public const PixelTypes CommonNonDefaultPixelTypes = PixelTypes.Rgba32 | PixelTypes.Argb32 | PixelTypes.RgbaVector;
Expand Down
4 changes: 2 additions & 2 deletions tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.

using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;

using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.Metadata.Profiles.Exif;
using SixLabors.ImageSharp.Metadata.Profiles.Icc;
Expand All @@ -20,6 +19,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class JpegEncoderTests
{
public static readonly TheoryData<string, int> QualityFiles =
Expand Down
3 changes: 2 additions & 1 deletion tests/ImageSharp.Tests/Formats/Jpg/JpegFileMarkerTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Six Labors.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.

using SixLabors.ImageSharp.Formats.Jpeg;
Expand All @@ -7,6 +7,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class JpegFileMarkerTests
{
[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class JpegImagePostProcessorTests
{
public static string[] BaselineTestJpegs =
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Jpg/JpegMetadataTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class JpegMetadataTests
{
[Fact]
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Jpg/LibJpegToolsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class LibJpegToolsTests
{
[Fact]
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Jpg/ParseStreamTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class ParseStreamTests
{
private ITestOutputHelper Output { get; }
Expand Down
1 change: 1 addition & 0 deletions tests/ImageSharp.Tests/Formats/Jpg/ProfileResolverTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public class ProfileResolverTests
{
private static readonly byte[] JFifMarker = Encoding.ASCII.GetBytes("JFIF\0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public partial class ReferenceImplementationsTests
{
public class AccurateDCT : JpegFixture
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace SixLabors.ImageSharp.Tests.Formats.Jpg
{
[Trait("Format", "Jpg")]
public partial class ReferenceImplementationsTests
{
public class FastFloatingPointDCT : JpegFixture
Expand Down
Loading

0 comments on commit 5ab768c

Please sign in to comment.