mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-03-14 17:00:17 +00:00
Use platform attribute for os specific tests
This commit is contained in:
parent
3fe5a709bb
commit
ff7a6dedeb
2 changed files with 15 additions and 48 deletions
|
@ -39,14 +39,10 @@ namespace Ryujinx.Memory.Tests
|
|||
}
|
||||
|
||||
[Test]
|
||||
// Memory aliasing tests fail on CI at the moment.
|
||||
[Platform(Exclude = "MacOsX")]
|
||||
public void Test_Alias()
|
||||
{
|
||||
if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
// Memory aliasing tests fail on CI at the moment.
|
||||
return;
|
||||
}
|
||||
|
||||
using MemoryBlock backing = new MemoryBlock(0x10000, MemoryAllocationFlags.Mirrorable);
|
||||
using MemoryBlock toAlias = new MemoryBlock(0x10000, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.ViewCompatible);
|
||||
|
||||
|
@ -58,14 +54,10 @@ namespace Ryujinx.Memory.Tests
|
|||
}
|
||||
|
||||
[Test]
|
||||
// Memory aliasing tests fail on CI at the moment.
|
||||
[Platform(Exclude = "MacOsX")]
|
||||
public void Test_AliasRandom()
|
||||
{
|
||||
if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
// Memory aliasing tests fail on CI at the moment.
|
||||
return;
|
||||
}
|
||||
|
||||
using MemoryBlock backing = new MemoryBlock(0x80000, MemoryAllocationFlags.Mirrorable);
|
||||
using MemoryBlock toAlias = new MemoryBlock(0x80000, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.ViewCompatible);
|
||||
|
||||
|
@ -94,14 +86,10 @@ namespace Ryujinx.Memory.Tests
|
|||
}
|
||||
|
||||
[Test]
|
||||
// Memory aliasing tests fail on CI at the moment.
|
||||
[Platform(Exclude = "MacOsX")]
|
||||
public void Test_AliasMapLeak()
|
||||
{
|
||||
if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
// Memory aliasing tests fail on CI at the moment.
|
||||
return;
|
||||
}
|
||||
|
||||
ulong pageSize = 4096;
|
||||
ulong size = 100000 * pageSize; // The mappings limit on Linux is usually around 65K, so let's make sure we are above that.
|
||||
|
||||
|
|
|
@ -57,14 +57,10 @@ namespace Ryujinx.Tests.Memory
|
|||
}
|
||||
|
||||
[Test]
|
||||
// Memory aliasing tests fail on CI at the moment.
|
||||
[Platform(Exclude = "MacOsX")]
|
||||
public void PartialUnmap([Values] bool readOnly)
|
||||
{
|
||||
if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
// Memory aliasing tests fail on CI at the moment.
|
||||
return;
|
||||
}
|
||||
|
||||
// Set up an address space to test partial unmapping.
|
||||
// Should register the signal handler to deal with this on Windows.
|
||||
ulong vaSize = 0x100000;
|
||||
|
@ -205,13 +201,10 @@ namespace Ryujinx.Tests.Memory
|
|||
}
|
||||
|
||||
[Test]
|
||||
// Memory aliasing tests fail on CI at the moment.
|
||||
[Platform(Exclude = "MacOsX")]
|
||||
public unsafe void PartialUnmapNative()
|
||||
{
|
||||
if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
// Memory aliasing tests fail on CI at the moment.
|
||||
return;
|
||||
}
|
||||
|
||||
// Set up an address space to test partial unmapping.
|
||||
// Should register the signal handler to deal with this on Windows.
|
||||
|
@ -288,26 +281,16 @@ namespace Ryujinx.Tests.Memory
|
|||
}
|
||||
|
||||
[Test]
|
||||
// Only test in Windows, as this is only used on Windows and uses Windows APIs for trimming.
|
||||
[Platform("Win")]
|
||||
public void ThreadLocalMap()
|
||||
{
|
||||
if (!OperatingSystem.IsWindows())
|
||||
{
|
||||
// Only test in Windows, as this is only used on Windows and uses Windows APIs for trimming.
|
||||
return;
|
||||
}
|
||||
|
||||
PartialUnmapState.Reset();
|
||||
ref var state = ref PartialUnmapState.GetRef();
|
||||
|
||||
bool running = true;
|
||||
var testThread = new Thread(() =>
|
||||
{
|
||||
if (!OperatingSystem.IsWindows())
|
||||
{
|
||||
// Need this here to avoid a warning.
|
||||
return;
|
||||
}
|
||||
|
||||
PartialUnmapState.GetRef().RetryFromAccessViolation();
|
||||
while (running)
|
||||
{
|
||||
|
@ -334,14 +317,10 @@ namespace Ryujinx.Tests.Memory
|
|||
}
|
||||
|
||||
[Test]
|
||||
// Only test in Windows, as this is only used on Windows and uses Windows APIs for trimming.
|
||||
[Platform("Win")]
|
||||
public unsafe void ThreadLocalMapNative()
|
||||
{
|
||||
if (!OperatingSystem.IsWindows())
|
||||
{
|
||||
// Only test in Windows, as this is only used on Windows and uses Windows APIs for trimming.
|
||||
return;
|
||||
}
|
||||
|
||||
EnsureTranslator();
|
||||
|
||||
PartialUnmapState.Reset();
|
||||
|
@ -485,4 +464,4 @@ namespace Ryujinx.Tests.Memory
|
|||
Assert.False(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue