mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
0c255e0f49
- Updates path handling code to system version 11.0.0. - Changes InMemoryFileSystem to normalize all incoming paths.
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System.Diagnostics;
|
|
using System.Linq;
|
|
using LibHac.Diag;
|
|
using LibHac.Tests;
|
|
using Xunit.Abstractions;
|
|
using Xunit.Sdk;
|
|
|
|
[assembly: Xunit.TestFramework("LibHac.Tests." + nameof(LibHacTestFramework), "LibHac.Tests")]
|
|
|
|
namespace LibHac.Tests
|
|
{
|
|
public class LibHacTestFramework : XunitTestFramework
|
|
{
|
|
public LibHacTestFramework(IMessageSink messageSink)
|
|
: base(messageSink)
|
|
{
|
|
SetDebugHandler();
|
|
SetResultNames();
|
|
}
|
|
|
|
// Todo: Catch assertions in PathToolTestGenerator.cpp
|
|
private static readonly string[] SkipAbortFunctions = { "Normalize" };
|
|
|
|
private static void SetDebugHandler()
|
|
{
|
|
AssertionFailureHandler handler = (in AssertionInfo info) =>
|
|
{
|
|
if (SkipAbortFunctions.Contains(info.FunctionName))
|
|
{
|
|
return AssertionFailureOperation.Continue;
|
|
}
|
|
|
|
return AssertionFailureOperation.Abort;
|
|
};
|
|
|
|
Assert.SetAssertionFailureHandler(handler);
|
|
Trace.Listeners.Clear();
|
|
Trace.Listeners.Add(new DebugAssertHandler());
|
|
}
|
|
|
|
private static void SetResultNames()
|
|
{
|
|
Result.SetNameResolver(new ResultNameResolver());
|
|
}
|
|
}
|
|
}
|