Skip platform tests in CI

This commit is contained in:
YoshiRulz 2021-02-03 12:32:33 +10:00
parent fb03771bb7
commit 2b72eabdf9
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 22 additions and 0 deletions

View File

@ -5,6 +5,7 @@
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
<DefineConstants Condition=" '$(GITLAB_CI)' != '' Or '$(APPVEYOR)' != '' ">$(DefineConstants);SKIP_PLATFORM_TESTS</DefineConstants>
<OutputPath>$(ProjectDir)../../test_output</OutputPath>
</PropertyGroup>
<ItemGroup>

View File

@ -13,6 +13,8 @@ namespace BizHawk.Tests.Common.PathExtensions
[TestMethod]
public void TestNullability()
{
PlatformTestUtils.RunEverywhere();
var p = OSTailoredCode.IsUnixHost ? "/" : @"C:\";
Assert.IsFalse(PE.IsSubfolderOf(childPath: null, parentPath: p));

View File

@ -8,17 +8,36 @@ namespace BizHawk.Tests
{
public static void OnlyRunOnRealUnix()
{
#if SKIP_PLATFORM_TESTS
Assert.Inconclusive();
#else
if (!OSTailoredCode.IsUnixHost || OSTailoredCode.IsWSL) Assert.Inconclusive();
#endif
}
public static void OnlyRunOnUnix()
{
#if SKIP_PLATFORM_TESTS
Assert.Inconclusive();
#else
if (!OSTailoredCode.IsUnixHost) Assert.Inconclusive();
#endif
}
public static void OnlyRunOnWindows()
{
#if SKIP_PLATFORM_TESTS
Assert.Inconclusive();
#else
if (OSTailoredCode.IsUnixHost) Assert.Inconclusive();
#endif
}
public static void RunEverywhere()
{
#if SKIP_PLATFORM_TESTS
Assert.Inconclusive();
#endif
}
}
}