Skip to content

Commit

Permalink
Also use a static constructor in the TestRuntime.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Sep 12, 2024
1 parent d936238 commit 6a99e4f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/Magick.NET.Tests/TestHelpers/TestRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ namespace Magick.NET.Tests;

internal static class TestRuntime
{
public static bool HasFlakyLinuxArm64Result { get; } = IsLinux && Runtime.Architecture is Architecture.Arm64;
static TestRuntime()
{
HasFlakyLinuxArm64Result = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && Runtime.Architecture is Architecture.Arm64;
HasFlakyMacOSResult = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
HasFlakyMacOSArm64Result = HasFlakyMacOSResult && Runtime.Architecture == Architecture.Arm64;
}

public static bool HasFlakyMacOSResult { get; } = IsMacOS;
public static bool HasFlakyLinuxArm64Result { get; }

public static bool HasFlakyMacOSArm64Result { get; } = IsMacOS && Runtime.Architecture is Architecture.Arm64;
public static bool HasFlakyMacOSResult { get; }

private static bool IsLinux { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
public static bool HasFlakyMacOSArm64Result { get; }

private static bool IsMacOS { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
private static bool IsMacOS { get; }
}

0 comments on commit 6a99e4f

Please sign in to comment.