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
19 changes: 19 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,25 @@ pub fn build(b: *std.Build) void {
// Charts read straight out of a .zip, and the aux files that travel with
// them: pure over std, so each tests alone.
_ = addPkgTest(b, test_step, "src/zipsrc.zig", target, optimize, &.{});
// src/chart.zig holds tests no other step collects: the engine imports it
// as a module, and a module import leaves another module's test blocks out.
// It needs libc for portray's embedded Lua.
addPkgTest(b, test_step, "src/chart.zig", target, optimize, &.{
.{ .name = "s57", .module = s57_mod },
.{ .name = "s101", .module = s101_mod },
.{ .name = "tiles", .module = tiles_mod },
.{ .name = "scene", .module = scene_mod },
.{ .name = "render", .module = render_mod },
.{ .name = "portray", .module = portray_mod },
.{ .name = "sprite", .module = sprite_mod },
.{ .name = "catalog", .module = catalog_embed },
.{ .name = "zipsrc", .module = zipsrc_mod },
.{ .name = "auxfiles", .module = auxfiles_mod },
.{ .name = "style", .module = style_mod },
.{ .name = "coverage", .module = coverage_mod },
.{ .name = "compose", .module = compose_mod },
.{ .name = "raster", .module = raster_mod },
}).link_libc = true;
_ = addPkgTest(b, test_step, "src/auxfiles.zig", target, optimize, &.{});
// Geometry core for the cross-band composition. No longer std-only: plane.zig
// reads its partition tuning/stats valves via std.c.getenv, so the test binary
Expand Down
11 changes: 11 additions & 0 deletions src/chart.zig
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ const zipsrc = @import("zipsrc"); // charts read straight out of a .zip
const auxfiles = @import("auxfiles"); // the text and pictures a cell points at
const raster_pkg = @import("raster"); // picture charts, for the inventory probe

// lua_shim.c is compiled into every binary that links the portray module, and
// it references 30 symbols exported from portray.zig, s101/catalogue.zig and
// portray/rules_embed.zig. Zig emits an export only after analyzing the
// declaration, and the tests in this file reach none of the three, so without
// these references a test binary links lua_shim.o against 30 undefined
// symbols. rules_embed follows from portray.
comptime {
_ = portray;
_ = catalogue;
}

// c_allocator, not smp_allocator: smp's per-CPU slab freelists never return
// pages to the OS, so a long-lived host process's footprint ratchets up to the
// worst transient peak (compose bursts) and never recovers. libc malloc frees
Expand Down
Loading