From 225c2be092fbe6e7464de2046937989f99a419e1 Mon Sep 17 00:00:00 2001 From: vnugent Date: Thu, 22 Aug 2024 21:56:47 -0400 Subject: ci: update and test c# libs for linux --- Taskfile.yaml | 6 ++++++ .../VNLib.Utils.Cryptography.Noscrypt/tests/LibNoscryptTests.cs | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 0af15f3..f66a6f9 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -54,6 +54,12 @@ tasks: vars: { BUILD_CONFIG: 'Debug' } - cmd: cd {{.CMAKE_BUILD_DIR}} && ctest -C Debug --verbose --output-on-failure + test-full: + desc: '(dotnet required) builds, and tests noscrypt using the .NET library test suite' + cmds: + - task: test + - cmd: dotnet test --logger 'console;verbosity=detailed' + compile: internal: true cmds: diff --git a/wrappers/dotnet/VNLib.Utils.Cryptography.Noscrypt/tests/LibNoscryptTests.cs b/wrappers/dotnet/VNLib.Utils.Cryptography.Noscrypt/tests/LibNoscryptTests.cs index 25f382a..ffa9cb6 100644 --- a/wrappers/dotnet/VNLib.Utils.Cryptography.Noscrypt/tests/LibNoscryptTests.cs +++ b/wrappers/dotnet/VNLib.Utils.Cryptography.Noscrypt/tests/LibNoscryptTests.cs @@ -17,6 +17,7 @@ namespace VNLib.Utils.Cryptography.Noscrypt.Tests { const string NoscryptLibWinDebug = @"../../../../../../../build/windows/Debug/noscrypt.dll"; + const string NoscryptLinuxDebug = @"../../../../../../../build/linux/libnoscrypt.so"; //Keys generated using npx noskey package @@ -36,7 +37,13 @@ namespace VNLib.Utils.Cryptography.Noscrypt.Tests [TestInitialize] public void Initialize() { - _testLib = NoscryptLibrary.Load(NoscryptLibWinDebug); + _testLib = Environment.OSVersion.Platform switch + { + PlatformID.Win32NT => NoscryptLibrary.Load(NoscryptLibWinDebug), + PlatformID.Unix => NoscryptLibrary.Load(NoscryptLinuxDebug), + _ => throw new PlatformNotSupportedException() + }; + _testVectors = JsonDocument.Parse(File.ReadAllText(Nip44VectorTestFile)); } -- cgit