volume-manager: content signature + the filesystems.csv map (S2)
partition.Volume gains a FilesystemKind signature (today .fat for every probed volume; S4 adds a real VBR recognizer for exFAT) — the seam filesystems.csv keys on to choose a service binary. New filesystem-map.zig parses `/system/configuration/filesystems.csv` (signature, binary) into rules and match()es a signature to its binary, mirroring the device registry: a signature no row matches goes unserved, never guessed; slices point into the source buffer. Three host tests (fat->binary, the binary is data-driven not hardcoded, malformed rows counted); the test rule buffer is a named fixture size so the bounds gate stays quiet. The VM's build gains the csv dependency and wires the filesystem-map test into its package test step. Not yet consumed by the binary — that lands when the VM loads the tables (step 4).
This commit is contained in:
@@ -17,14 +17,27 @@ pub fn build(b: *std.Build) void {
|
||||
});
|
||||
b.installArtifact(exe);
|
||||
|
||||
// Standalone `zig build test` for the partition parser; the root build keeps
|
||||
// its aggregate test step.
|
||||
const test_step = b.step("test", "Run the partition-parser unit tests");
|
||||
const tests = b.addTest(.{
|
||||
// Standalone `zig build test` for the parser + mount-map modules; the root
|
||||
// build keeps its aggregate test step.
|
||||
const csv = b.dependency("csv", .{});
|
||||
const test_step = b.step("test", "Run the partition parser + mount-map unit tests");
|
||||
|
||||
const partition_tests = b.addTest(.{
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("partition.zig"),
|
||||
.target = b.resolveTargetQuery(.{}),
|
||||
}),
|
||||
});
|
||||
test_step.dependOn(&b.addRunArtifact(tests).step);
|
||||
test_step.dependOn(&b.addRunArtifact(partition_tests).step);
|
||||
|
||||
// filesystem-map imports csv (and, by path, partition.zig), so its test
|
||||
// module needs csv wired.
|
||||
const filesystem_map_tests = b.addTest(.{
|
||||
.root_module = b.createModule(.{
|
||||
.root_source_file = b.path("filesystem-map.zig"),
|
||||
.target = b.resolveTargetQuery(.{}),
|
||||
.imports = &.{.{ .name = "csv", .module = csv.module("csv") }},
|
||||
}),
|
||||
});
|
||||
test_step.dependOn(&b.addRunArtifact(filesystem_map_tests).step);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user