summaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig16
1 files changed, 14 insertions, 2 deletions
diff --git a/build.zig b/build.zig
index 37156ca..a7e9edb 100644
--- a/build.zig
+++ b/build.zig
@@ -99,7 +99,6 @@ pub fn build(b: *std.Build) void {
if (oracle) readPeripheralsLd(b, registers.idf_path) else null,
));
-
// ---------------------------------------------------------------- the application
const options = b.addOptions();
options.addOption(u8, "led_pin", led_pin);
@@ -330,7 +329,6 @@ pub fn build(b: *std.Build) void {
app.link_function_sections = true;
app.link_data_sections = true;
-
// One install step for the ELF, reachable two ways: `zig build elf` on its own (handy when
// debugging the image builder) and `-Delf` to get it alongside the image.
const elf_only = b.addInstallArtifact(app, .{});
@@ -502,6 +500,20 @@ pub fn build(b: *std.Build) void {
});
test_step.dependOn(&b.addRunArtifact(console_tests).step);
+ // The input-rescue policy: drain the receiver while spinning on a full transmitter. This is a
+ // decision rather than a register access, and it was a measured bug - a 200-byte burst typed
+ // into a long frame lost 88 bytes on the die - so it is worth a test that fails without the
+ // fix. `pump` takes its port as `anytype` precisely so the same code can run against a fake
+ // with a two-byte FIFO here and against UART0 on the board.
+ const rescue_tests = b.addTest(.{
+ .root_module = b.createModule(.{
+ .root_source_file = b.path("src/pardes/input_rescue.zig"),
+ .target = b.graph.host,
+ .optimize = .Debug,
+ }),
+ });
+ test_step.dependOn(&b.addRunArtifact(rescue_tests).step);
+
// The measurement protocol. These are the tests that keep a throughput number honest: that a
// frame round-trips, that a short read is "incomplete" rather than "invalid", that a lost byte
// mid-stream changes the CRC, and that the pattern generator does not repeat on a 256-byte