Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ jobs:
run: >
dotnet test LibLouis.NET.Test/LibLouis.NET.Test.csproj
--configuration Release
-warnaserror
-p:RestoreAdditionalProjectSources=${{ github.workspace }}/local-feed

# Managed packages. Split from native-linux because building LibLouis.NET resolves
Expand Down
6 changes: 5 additions & 1 deletion LibLouis.NET.Test/LiblouisHeapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ public unsafe class LiblouisHeapTests
{
private static readonly string[] Tables = ["da-dk-g26.ctb", "da-dk-g16-markers.ctb"];

// The C runtimes a mingw-built liblouis.dll can import free() from: msvcrt.dll for the gcc
// builds, ucrtbase.dll for llvm-mingw.
private static readonly string[] WindowsRuntimes = ["msvcrt.dll", "ucrtbase.dll"];

private static string[] TablePaths() =>
[.. Tables.Select(t => Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "tables", t))];

Expand Down Expand Up @@ -123,7 +127,7 @@ public void FindImport_FindsFreeInTheLiblouisWeShip()
nint module = NativeLibrary.Load("liblouis", typeof(LibLouis).Assembly, DllImportSearchPath.SafeDirectories);
nint free = LiblouisHeap.FindImport((byte*)module, "free"u8);

nint[] runtimeFrees = [.. new[] { "msvcrt.dll", "ucrtbase.dll" }
nint[] runtimeFrees = [.. WindowsRuntimes
.Select(name => NativeLibrary.TryLoad(name, out nint runtime) ? NativeLibrary.GetExport(runtime, "free") : 0)];

Assert.NotEqual(0, free);
Expand Down
3 changes: 2 additions & 1 deletion build/build_managed_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ if [ -n "${NUGET_LOCAL_FEED:-}" ]; then
restore_args="-p:RestoreAdditionalProjectSources=$NUGET_LOCAL_FEED"
fi

dotnet build --configuration Release $restore_args "$REPO_ROOT/LibLouis.NET.slnx"
# -warnaserror keeps the build warning free: a warning fails the packages rather than shipping.
dotnet build --configuration Release -warnaserror $restore_args "$REPO_ROOT/LibLouis.NET.slnx"

if [ -z "${SKIP_TESTS:-}" ]; then
dotnet test --configuration Release --no-build "$REPO_ROOT/LibLouis.NET.slnx"
Expand Down
Loading