diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-05 10:46:03 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-05 15:12:36 -0300 |
| commit | 11204e1206f7f7ffeaa861c1a442a312e563d3ed (patch) | |
| tree | f788736bf5b6a56694563b664b5db73bc54bff72 /test | |
| parent | c9b9dad8469f5d654c31d688d7e2d93da8325f39 (diff) | |
| download | pardes-11204e1206f7f7ffeaa861c1a442a312e563d3ed.tar.gz pardes-11204e1206f7f7ffeaa861c1a442a312e563d3ed.zip | |
effects out, the post chain: Crt, Bloom, Vignette, Grain, Shader and ShaderAnimation go with src/gui/Post.zig, src/ShaderBuild.zig (the run-time glslc spawn and its watched files), shaders/post/, post.vert, bloom-down and bloom-up and their prebuilt .spv, the window's scene texture and its post-chain-only redraw (level A), the disable_scene_effects tape site and Pardes.disableSceneEffects; EffectCode goes with src/effect_sources.zig, which only embedded the effects' sources (/virtual keeps src/); the corner-click test keeps its point without a chain, the window monkey loses its Bloom axis; macOS's post-processor (ScenePostprocessor.swift, crt.ci.metal, pardes_scene) is a change of its own
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test')
| -rw-r--r-- | test/behaviour/settings.zig | 8 | ||||
| -rw-r--r-- | test/output.zig | 53 | ||||
| -rw-r--r-- | test/process/window.zig | 19 |
3 files changed, 14 insertions, 66 deletions
diff --git a/test/behaviour/settings.zig b/test/behaviour/settings.zig index c4d93419..4b0245d2 100644 --- a/test/behaviour/settings.zig +++ b/test/behaviour/settings.zig @@ -257,16 +257,14 @@ test "settings: every on/off setting the root ctl reads flips when its word is w const word, const was = .{ line[0..space], line[space + 1 ..] }; const on = std.mem.eql(u8, was, "on"); if (!on and !std.mem.eql(u8, was, "off")) continue; - // Shader's and Pet's `off` say they have no file and no pet; each takes - // a name, not a flip. - if (std.mem.eql(u8, word, "Shader") or std.mem.eql(u8, word, "Pet")) continue; + // Pet's `off` says it has no pet; it takes a name, not a flip. + if (std.mem.eql(u8, word, "Pet")) continue; s.write("/ctl", s.at("{s}\n", .{word})) catch |err| { std.debug.print("a bare {s} (was {s}) was refused\n", .{ word, was }); return err; }; // A bare word moves the setting: a toggle to its other side, one with - // more states (Lift's auto, Crt's level, ShaderAnimation's always) to - // the next, never nowhere. + // more states (Lift's auto) to the next, never nowhere. const after = try setting(&s, word); try std.testing.expect(std.mem.startsWith(u8, after, word)); try std.testing.expect(!std.mem.eql(u8, after, line)); diff --git a/test/output.zig b/test/output.zig index eb4da9b3..e998ac66 100644 --- a/test/output.zig +++ b/test/output.zig @@ -549,50 +549,7 @@ test "Config with no startup file opens a pane of its name, and Save makes its d try std.testing.expectEqual(std.Io.File.Kind.directory, made.kind); } -test "EffectCode lists readable virtual sources used by this backend" { - if (comptime !builtins.EffectCode.enabled) return; - const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true }); - defer p.deinit(); - - if (!pardes.memory.limits.embedded_sources) { - const before = p.active; - try std.testing.expect(p.executeBuiltinLine(0, "EffectCode PanelSlide")); - try std.testing.expectEqual(before, p.active); - return error.SkipZigTest; - } - try std.testing.expect(p.executeBuiltinLine(0, "EffectCode PanelSlide")); - const out = p.panes[p.active].?.file.?; - try std.testing.expectEqualStrings(config.effect_code_buffer, std.fs.path.basename(out.path)); - try std.testing.expectEqual(panes.Output.Origin{ .cmd = .EffectCode }, out.output.?.from); - try std.testing.expectEqualStrings("PanelSlide", out.output.?.arg()); - try std.testing.expect(out.content.len < 1024); - try std.testing.expect(std.mem.indexOf(u8, out.content, "/virtual/src/layout.zig\n") != null); - const backend_source = switch (platform) { - .tui => "/virtual/src/tui/panel_compositor.zig", - .gui => "/virtual/shaders/ui.vert.glsl", - .macos => "/virtual/src/macos/Sources/ScenePostprocessor.swift", - }; - try std.testing.expect(std.mem.indexOf(u8, out.content, backend_source) != null); - var paths = std.mem.tokenizeScalar(u8, out.content, '\n'); - var count: usize = 0; - while (paths.next()) |path| { - if (!std.mem.startsWith(u8, path, "/virtual/")) continue; - const expected = pardes.filesystem.sourceBytes(path["/virtual/".len..]) orelse return error.MissingEffectSource; - const bytes = try pardes.filesystem.read(p, path); - defer p.gpa.free(bytes); - try std.testing.expectEqualStrings(expected, bytes); - count += 1; - } - try std.testing.expect(count >= 3); - const report = p.active; - pardes.look.lookAt(p, report, backend_source); - try std.testing.expect(p.active != report); - const source = p.panes[p.active].?.file.?; - try std.testing.expectEqualStrings(backend_source, source.path); - try std.testing.expectEqualStrings(pardes.filesystem.sourceBytes(backend_source["/virtual/".len..]).?, source.content); -} - -test "a window's setting builtins (TaglineSize, Font, transitions, scene passes) reach the report DumpConfig writes" { +test "a window's setting builtins (TaglineSize, Font, transitions) reach the report DumpConfig writes" { const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true }); defer p.deinit(); p.locations_config.layout = .@"inline"; @@ -629,7 +586,7 @@ test "a window's setting builtins (TaglineSize, Font, transitions, scene passes) try std.testing.expect(p.executeBuiltinLine(p.active, "DumpConfig")); const report = p.panes[p.active].?.file.?.content; // The toggles, Theme and Shell are test/behaviour/settings.zig's, through - // the root ctl; what is left is a window's (fonts, transitions, passes). + // the root ctl; what is left is a window's (fonts, transitions). const transition = if (!builtins.viewCapabilities(p).panel_transitions) "PanelSlide unsupported\n" else if (p.settings.panel_transition == .off) @@ -637,12 +594,6 @@ test "a window's setting builtins (TaglineSize, Font, transitions, scene passes) else try std.fmt.bufPrint(&buf, "{s} on\n", .{config.Runtime.findAction(.{ .transition = p.settings.panel_transition }).?.word}); try std.testing.expect(std.mem.indexOf(u8, report, transition) != null); - // A bare word turns a bundled pass on at its default level. - const scene_status = if (builtins.viewCapabilities(p).scene_shaders) "2" else "unsupported"; - for ([_][]const u8{"Crt"}) |name| { - const line = try std.fmt.bufPrint(&buf, "{s} {s}\n", .{ name, scene_status }); - try std.testing.expect(std.mem.indexOf(u8, report, line) != null); - } const tagline = if (!builtins.viewCapabilities(p).tagline_font_size) "TaglineSize unsupported\n" else diff --git a/test/process/window.zig b/test/process/window.zig index 1fe2fd2e..40d2e6a6 100644 --- a/test/process/window.zig +++ b/test/process/window.zig @@ -30,13 +30,12 @@ fn paneWith(f: *process.Files, word: []const u8) !u32 { const motions = [_][]const u8{ "off", "crisp", "smooth", "bouncy", "playful" }; const lifts = [_][]const u8{ "off", "shadow", "rim", "auto" }; -const blooms = [_][]const u8{ "0", "2" }; const themes = [_][]const u8{ "lapis", "lapis_plain", "forge", "acme", "dusk", "daybreak" }; -/// test/gui_monkey.py's: each Motion x Lift x Bloom gets a random burst, -/// then must settle with its process alive and no crash record. Two +/// test/gui_monkey.py's: each Motion x Lift gets a random burst, then +/// must settle with its process alive and no crash record. Two /// combinations and 30 steps in process-test; PARDES_GUI_MONKEY=all runs -/// all 40 (`zig build monkey-gui`), PARDES_GUI_MONKEY_SEED and _STEPS +/// all 20 (`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); @@ -45,20 +44,20 @@ fn monkey(gpa: std.mem.Allocator, exe: [:0]const u8) !void { 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| for (lifts) |l| for (blooms) |b| { + for (motions) |m| for (lifts) |l| { defer n += 1; // The smoke run: the quietest combination and the busiest. - if (!all and n != 0 and n != motions.len * lifts.len * blooms.len - 1) continue; - if (!try monkeyOne(gpa, exe, m, l, b, seed * 1000 + n, steps)) failed += 1; + if (!all and n != 0 and n != motions.len * lifts.len - 1) continue; + if (!try monkeyOne(gpa, exe, m, l, 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, lift: []const u8, bloom: []const u8, seed: u64, steps: usize) !bool { +fn monkeyOne(gpa: std.mem.Allocator, exe: [:0]const u8, motion: []const u8, lift: []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}\nLift {s}\nBloom {s}\nPanelSlide\nSelectionGlow on\nHoverGlow on\n", .{ motion, lift, bloom }); + const init = try std.fmt.allocPrint(a, "Shell /bin/sh\nMessageLinger 0\nMotion {s}\nLift {s}\nPanelSlide\nSelectionGlow on\nHoverGlow on\n", .{ motion, lift }); var d = try process.Detached.start(gpa, exe, "monkey", .{ .init = init, .grid = .{ 80, 28 }, .env = &.{ .{ "PARDES_TEST_CLOCK", "1" }, .{ "PARDES_TEST_PAD", "0" }, } }); @@ -102,7 +101,7 @@ fn monkeyOne(gpa: std.mem.Allocator, exe: [:0]const u8, motion: []const u8, lift }; } else |_| {} const ok = std.mem.eql(u8, verdict, "ok"); - if (!ok) std.debug.print("monkey {s}-{s}-bloom{s} (seed {d}): {s}\n{s}", .{ motion, lift, bloom, seed, verdict, log.items }); + if (!ok) std.debug.print("monkey {s}-{s} (seed {d}): {s}\n{s}", .{ motion, lift, seed, verdict, log.items }); return ok; } |
