diff --git a/.gitattributes b/.gitattributes index 031420e53..a0643702b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -110,6 +110,7 @@ ############################################################################### # Handle image files by git lfs ############################################################################### +*.pdf filter=lfs diff=lfs merge=lfs -text *.jpg filter=lfs diff=lfs merge=lfs -text *.jpeg filter=lfs diff=lfs merge=lfs -text *.bmp filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 634b904ae..bb0962784 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -64,48 +64,48 @@ jobs: matrix: options: - os: ubuntu-latest - framework: net10.0 - sdk: 10.0.x + framework: net11.0 + sdk: 11.0.x sdk-preview: true runtime: -x64 codecov: false - os: macos-26 - framework: net10.0 - sdk: 10.0.x + framework: net11.0 + sdk: 11.0.x sdk-preview: true runtime: -x64 codecov: false - os: windows-latest - framework: net10.0 - sdk: 10.0.x + framework: net11.0 + sdk: 11.0.x sdk-preview: true runtime: -x64 codecov: false - os: ubuntu-22.04-arm - framework: net10.0 - sdk: 10.0.x + framework: net11.0 + sdk: 11.0.x sdk-preview: true runtime: -x64 codecov: false - os: ubuntu-latest - framework: net8.0 - sdk: 8.0.x + framework: net10.0 + sdk: 10.0.x runtime: -x64 codecov: false - os: macos-26 - framework: net8.0 - sdk: 8.0.x + framework: net10.0 + sdk: 10.0.x runtime: -x64 codecov: false - os: windows-latest - framework: net8.0 - sdk: 8.0.x + framework: net10.0 + sdk: 10.0.x runtime: -x64 codecov: false - os: ubuntu-22.04-arm - framework: net8.0 - sdk: 8.0.x + framework: net10.0 + sdk: 10.0.x runtime: -x64 codecov: false @@ -169,14 +169,15 @@ jobs: uses: actions/setup-dotnet@v6 with: dotnet-version: | - 8.0.x + 10.0.x - name: DotNet Setup Preview if: ${{ matrix.options.sdk-preview == true }} uses: actions/setup-dotnet@v6 with: + dotnet-quality: preview dotnet-version: | - 10.0.x + 11.0.x - name: DotNet Build if: ${{ matrix.options.sdk-preview != true }} diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index 00f489b40..eca2f190f 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -11,7 +11,7 @@ jobs: matrix: options: - os: ubuntu-latest - framework: net8.0 + framework: net10.0 runtime: -x64 codecov: true @@ -70,7 +70,7 @@ jobs: uses: actions/setup-dotnet@v6 with: dotnet-version: | - 8.0.x + 10.0.x - name: DotNet Build shell: pwsh diff --git a/Directory.Build.props b/Directory.Build.props index 9bda76f88..ab898020c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -21,14 +21,6 @@ - - 12.0 - - - - 14.0 - - - + diff --git a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj index 0351ecae9..e060e1f33 100644 --- a/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj +++ b/tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj @@ -39,12 +39,12 @@ - net8.0;net10.0 + net10.0;net11.0 - net8.0 + net10.0 diff --git a/tests/ImageSharp.PublicApi.Tests/ImageSharp.PublicApi.Tests.csproj b/tests/ImageSharp.PublicApi.Tests/ImageSharp.PublicApi.Tests.csproj index 33bbc1b94..bab8095c5 100644 --- a/tests/ImageSharp.PublicApi.Tests/ImageSharp.PublicApi.Tests.csproj +++ b/tests/ImageSharp.PublicApi.Tests/ImageSharp.PublicApi.Tests.csproj @@ -10,12 +10,12 @@ - net8.0;net10.0 + net10.0;net11.0 - net8.0 + net10.0 diff --git a/tests/ImageSharp.Tests.ProfilingSandbox/ImageSharp.Tests.ProfilingSandbox.csproj b/tests/ImageSharp.Tests.ProfilingSandbox/ImageSharp.Tests.ProfilingSandbox.csproj index f3aa910b9..658e32999 100644 --- a/tests/ImageSharp.Tests.ProfilingSandbox/ImageSharp.Tests.ProfilingSandbox.csproj +++ b/tests/ImageSharp.Tests.ProfilingSandbox/ImageSharp.Tests.ProfilingSandbox.csproj @@ -18,12 +18,12 @@ - net8.0;net10.0 + net10.0;net11.0 - net8.0 + net10.0 diff --git a/tests/ImageSharp.Tests/IO/LocalFileSystemTests.cs b/tests/ImageSharp.Tests/IO/LocalFileSystemTests.cs index a1eeb2597..56864680d 100644 --- a/tests/ImageSharp.Tests/IO/LocalFileSystemTests.cs +++ b/tests/ImageSharp.Tests/IO/LocalFileSystemTests.cs @@ -50,7 +50,12 @@ public class LocalFileSystemTests await using (FileStream stream = (FileStream)fs.OpenReadAsynchronous(path)) using (StreamReader reader = new(stream)) { + // .NET 11 reports IsAsync false for regular files on Unix: https://github.com/dotnet/runtime/pull/125220 +#if NET11_0_OR_GREATER + Assert.Equal(OperatingSystem.IsWindows(), stream.IsAsync); +#else Assert.True(stream.IsAsync); +#endif Assert.True(stream.CanRead); Assert.False(stream.CanWrite); @@ -105,7 +110,12 @@ public class LocalFileSystemTests await using (FileStream stream = (FileStream)fs.CreateAsynchronous(path)) await using (StreamWriter writer = new(stream)) { + // .NET 11 reports IsAsync false for regular files on Unix: https://github.com/dotnet/runtime/pull/125220 +#if NET11_0_OR_GREATER + Assert.Equal(OperatingSystem.IsWindows(), stream.IsAsync); +#else Assert.True(stream.IsAsync); +#endif Assert.True(stream.CanRead); Assert.True(stream.CanWrite); diff --git a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj index 25d30b514..9c9ee8da6 100644 --- a/tests/ImageSharp.Tests/ImageSharp.Tests.csproj +++ b/tests/ImageSharp.Tests/ImageSharp.Tests.csproj @@ -12,12 +12,12 @@ - net8.0;net10.0 + net10.0;net11.0 - net8.0 + net10.0 diff --git a/tests/ImageSharp.Tests/TestUtilities/FeatureTesting/FeatureTestRunner.cs b/tests/ImageSharp.Tests/TestUtilities/FeatureTesting/FeatureTestRunner.cs index bbe5f221a..d0b77882d 100644 --- a/tests/ImageSharp.Tests/TestUtilities/FeatureTesting/FeatureTestRunner.cs +++ b/tests/ImageSharp.Tests/TestUtilities/FeatureTesting/FeatureTestRunner.cs @@ -414,7 +414,14 @@ public static class FeatureTestRunner // Not a COMPlus value. We filter in calling method. features.Add(key, nameof(HwIntrinsics.AllowAll)); break; +#if NET11_0_OR_GREATER + case nameof(HwIntrinsics.DisableSSE42): + // SSE3 through SSE4.2 and POPCNT are x86-64-v2 baseline in .NET 11+ and the + // switch is inert, so skip it entirely rather than spawn a child that tests nothing. + // https://learn.microsoft.com/en-us/dotnet/core/compatibility/jit/11/minimum-hardware-requirements + break; +#endif default: features.Add(key, intrinsic.Replace("Disable", "Enable")); break; diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/FeatureTestRunnerTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/FeatureTestRunnerTests.cs index 74ad85b79..8b9210636 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/FeatureTestRunnerTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/FeatureTestRunnerTests.cs @@ -11,20 +11,25 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.Tests; public class FeatureTestRunnerTests { - public static TheoryData Intrinsics => + public static TheoryData Intrinsics => new() { - { HwIntrinsics.DisableAES | HwIntrinsics.AllowAll, ["EnableAES", "AllowAll"] }, - { HwIntrinsics.DisableHWIntrinsic, ["EnableHWIntrinsic"] }, - { HwIntrinsics.DisableSSE42 | HwIntrinsics.DisableAVX, ["EnableSSE42", "EnableAVX"] } + { HwIntrinsics.DisableAES | HwIntrinsics.AllowAll, HwIntrinsics.DisableAES | HwIntrinsics.AllowAll, ["EnableAES", "AllowAll"] }, + { HwIntrinsics.DisableHWIntrinsic, HwIntrinsics.DisableHWIntrinsic, ["EnableHWIntrinsic"] }, +#if NET11_0_OR_GREATER + // ToFeatureKeyValueCollection filters DisableSSE42: SSE4.2 is x86-64-v2 baseline in .NET 11+ and cannot be disabled. + { HwIntrinsics.DisableSSE42 | HwIntrinsics.DisableAVX, HwIntrinsics.DisableAVX, ["EnableAVX"] } +#else + { HwIntrinsics.DisableSSE42 | HwIntrinsics.DisableAVX, HwIntrinsics.DisableSSE42 | HwIntrinsics.DisableAVX, ["EnableSSE42", "EnableAVX"] } +#endif }; [Theory] [MemberData(nameof(Intrinsics))] - public void ToFeatureCollectionReturnsExpectedResult(HwIntrinsics expectedIntrinsics, string[] expectedValues) + public void ToFeatureCollectionReturnsExpectedResult(HwIntrinsics intrinsics, HwIntrinsics expectedIntrinsics, string[] expectedValues) { - Dictionary features = expectedIntrinsics.ToFeatureKeyValueCollection(); - HwIntrinsics[] keys = features.Keys.ToArray(); + Dictionary features = intrinsics.ToFeatureKeyValueCollection(); + HwIntrinsics[] keys = [.. features.Keys]; HwIntrinsics actualIntrinsics = keys[0]; for (int i = 1; i < keys.Length; i++) @@ -122,9 +127,8 @@ public class FeatureTestRunnerTests Assert.False(Ssse3.IsSupported, "Ssse3 should be disabled."); Assert.False(Sse41.IsSupported, "Sse41 should be disabled."); Assert.False(Popcnt.IsSupported, "Popcnt should be disabled."); -#else - Assert.False(Sse42.IsSupported, "Sse42 should be disabled when DisableSSE42 is set."); #endif + Assert.False(Sse42.IsSupported, "Sse42 should be disabled when DisableSSE42 is set."); break; case HwIntrinsics.DisableAVX: Assert.False(Avx.IsSupported, "AVX should be disabled when DisableAVX is set."); @@ -169,12 +173,12 @@ public class FeatureTestRunnerTests { Assert.NotNull(serializable); Assert.NotNull(FeatureTestRunner.DeserializeForXunit(serializable)); - Assert.False(Sse42.IsSupported, "SSE42 should be disabled when DisableSSE42 is set (sanity check using serializable param overload)."); + Assert.False(Avx.IsSupported, "AVX should be disabled when DisableAVX is set (sanity check using serializable param overload)."); } FeatureTestRunner.RunWithHwIntrinsicsFeature( AssertHwIntrinsicsFeatureDisabled, - HwIntrinsics.DisableSSE42, + HwIntrinsics.DisableAVX, new FakeSerializable()); } @@ -256,7 +260,7 @@ public class FeatureTestRunnerTests } } - foreach (HwIntrinsics intrinsic in (HwIntrinsics[])Enum.GetValues(typeof(HwIntrinsics))) + foreach (HwIntrinsics intrinsic in Enum.GetValues()) { FeatureTestRunner.RunWithHwIntrinsicsFeature(AssertHwIntrinsicsFeatureDisabled, intrinsic, new FakeSerializable()); }