diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/monkey9p.zig | 2 | ||||
| -rw-r--r-- | test/pdf.zig | 4 | ||||
| -rw-r--r-- | test/process/window.zig | 23 | ||||
| -rw-r--r-- | test/snapshot.zig | 2 |
4 files changed, 12 insertions, 19 deletions
diff --git a/test/monkey9p.zig b/test/monkey9p.zig index 692550a5..db0c555e 100644 --- a/test/monkey9p.zig +++ b/test/monkey9p.zig @@ -74,7 +74,7 @@ const builtins = [_][]const u8{ "Palette", "Ascii", "Save", "New", "Newcol", "Del", "Filter", "Mode", "Togglettymode", "Edit", "Undo", "Redo", "Collapse", "Delcol", "DelAbove", "DelBelow", "Term", "Repl", "Joincol", "Config", "LocationsConfig", "Messages", "Mini", "Find", "Grep", "Left", "Down", "Up", "Right", "Back", "Forward", "Last", "Recent", "Jumplist", "Colors", "Wrap", "Tagbottom", "Debug", "FocusTint", - "Verbose", "Motion", "SyntaxBold", "DumpDir", "Theme", "Get", "Put", "Undo", "Redo", "Zerox", "Snarf", "Paste", "Cut", + "Verbose", "SyntaxBold", "DumpDir", "Theme", "Get", "Put", "Undo", "Redo", "Zerox", "Snarf", "Paste", "Cut", "Sort", "Font", "Local", }; const pane_files = [_][]const u8{ "name", "body", "tag", "ctl", "addr", "dot", "limit", "data", "xdata", "sel", "dirty", "mark", "scroll", "errors", "event", "look", "exec", "tagexec", "pty", "pty/run", "pty/data", "pty/ctl", "pty/status" }; diff --git a/test/pdf.zig b/test/pdf.zig index f338bfcb..de7afb95 100644 --- a/test/pdf.zig +++ b/test/pdf.zig @@ -7,7 +7,7 @@ const image = pardes.image; const config = pardes.config; const builtins = pardes.builtins; const layout = pardes.layout; -const animation = pardes.animation; + const dump = pardes.dump; const Pardes = pardes.Pardes; @@ -546,7 +546,6 @@ test "MuPDF pane renders, navigates, searches, and round-trips its page" { .rows = 24, }); defer p.deinit(); - p.settings.motion = .off; // placements, not the glide (anim 11) const pane = p.panes[0].?; try std.testing.expect(hasPdf(pane)); try std.testing.expect(pane.pdf.?.page_count > 1); @@ -1309,7 +1308,6 @@ test "PDF tint and tinted theme changes rebuild every visible raster only" { .rows = 24, }); defer p.deinit(); - p.settings.motion = .off; // placements, not the glide (anim 11) const pane = p.panes[0].?; const pv = pane.pdf.?; p.native_images = true; diff --git a/test/process/window.zig b/test/process/window.zig index 3a64d910..3d197c09 100644 --- a/test/process/window.zig +++ b/test/process/window.zig @@ -28,34 +28,29 @@ fn paneWith(f: *process.Files, word: []const u8) !u32 { return error.NoSuchPane; } -const motions = [_][]const u8{ "off", "crisp", "smooth", "bouncy", "playful" }; const themes = [_][]const u8{ "lapis", "forge", "acme", "dusk", "daybreak" }; -/// test/gui_monkey.py's: each Motion gets a random burst, then must -/// settle with its process alive and no crash record. Two of them and 30 -/// steps in process-test; PARDES_GUI_MONKEY=all runs all 5 (`zig build -/// monkey-gui`), PARDES_GUI_MONKEY_SEED and _STEPS choose the rest. +/// test/gui_monkey.py's: random bursts, each run then settling with its +/// process alive and no crash record. Two runs of 30 steps in +/// process-test; PARDES_GUI_MONKEY=all runs 5 (`zig build monkey-gui`), +/// PARDES_GUI_MONKEY_SEED and _STEPS choose the rest. fn monkey(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try process.only(.gui); const all = std.mem.eql(u8, envOr("PARDES_GUI_MONKEY", ""), "all"); const seed = try std.fmt.parseInt(u64, envOr("PARDES_GUI_MONKEY_SEED", "1"), 10); const steps = try std.fmt.parseInt(usize, envOr("PARDES_GUI_MONKEY_STEPS", if (all) "60" else "30"), 10); var failed: usize = 0; - var n: usize = 0; - for (motions) |m| { - defer n += 1; - // The smoke run: the quietest and the busiest. - if (!all and n != 0 and n != motions.len - 1) continue; - if (!try monkeyOne(gpa, exe, m, seed * 1000 + n, steps)) failed += 1; + for (0..@as(usize, if (all) 5 else 2)) |n| { + if (!try monkeyOne(gpa, exe, seed * 1000 + n, steps)) failed += 1; } if (failed > 0) return error.MonkeyFailed; } -fn monkeyOne(gpa: std.mem.Allocator, exe: [:0]const u8, motion: []const u8, seed: u64, steps: usize) !bool { +fn monkeyOne(gpa: std.mem.Allocator, exe: [:0]const u8, seed: u64, steps: usize) !bool { var arena = std.heap.ArenaAllocator.init(gpa); defer arena.deinit(); const a = arena.allocator(); - const init = try std.fmt.allocPrint(a, "Shell /bin/sh\nMessageLinger 0\nMotion {s}\n", .{motion}); + const init = "Shell /bin/sh\nMessageLinger 0\n"; var d = try process.Detached.start(gpa, exe, "monkey", .{ .init = init, .grid = .{ 80, 28 }, .env = &.{ .{ "PARDES_TEST_CLOCK", "1" }, .{ "PARDES_TEST_PAD", "0" }, } }); @@ -99,7 +94,7 @@ fn monkeyOne(gpa: std.mem.Allocator, exe: [:0]const u8, motion: []const u8, seed }; } else |_| {} const ok = std.mem.eql(u8, verdict, "ok"); - if (!ok) std.debug.print("monkey {s} (seed {d}): {s}\n{s}", .{ motion, seed, verdict, log.items }); + if (!ok) std.debug.print("monkey (seed {d}): {s}\n{s}", .{ seed, verdict, log.items }); return ok; } diff --git a/test/snapshot.zig b/test/snapshot.zig index dc4f2604..02215abd 100644 --- a/test/snapshot.zig +++ b/test/snapshot.zig @@ -1057,7 +1057,7 @@ fn waitStable(h: *eh.Harness, quiet: i64, timeout: i64) !void { // 54 of them saw a later change, none later than 11ms at 20 jobs. That is the // scheduler-tick case. The number the sum is really sized for is bigger and // found by adversarial measurement: a theme transition sleeps -// `animation.frame_ms` (16ms) between frames with the whole tree asleep, and +// `pardes.frame_ms` (16ms) between frames with the whole tree asleep, and // under `taskset -c 0,1` those gaps stretch to 57ms. 60ms total stays. var probe_after_ms: i64 = 50; const probe_every_ms: i64 = 5; |
