process/src/process.tests/_fixture/PlatformAttribute.cs
Louis Seubert 48c483c568
All checks were successful
release / dotnet-release-workflow (push) Successful in 1m23s
build: initial project release
2026-05-10 10:49:39 +02:00

35 lines
No EOL
1,019 B
C#

// Copyright (c) The Geekeey Authors
// SPDX-License-Identifier: EUPL-1.2
namespace Geekeey.Process.Tests;
internal sealed class PlatformAttribute : SkipAttribute
{
// from the OperatingSystem definitions
public const string Browser = "BROWSER";
public const string Wasi = "WASI";
public const string Windows = "WINDOWS";
public const string Osx = "OSX";
public const string MacCatalyst = "MACCATALYST";
public const string Ios = "IOS";
public const string Tvos = "TVOS";
public const string Android = "ANDROID";
public const string Linux = "LINUX";
public const string Freebsd = "FREEBSD";
public const string Netbsd = "NETBSD";
public const string Illumos = "ILLUMOS";
public const string Solaris = "SOLARIS";
private readonly string[] _os;
public PlatformAttribute(params string[] os) : base("Test skipped on unsupported platform.")
{
_os = os;
}
public override Task<bool> ShouldSkip(TestRegisteredContext context)
{
return Task.FromResult(!_os.Any(OperatingSystem.IsOSPlatform));
}
}