# The helper programs the checks need inside the guest (and, for the fake # capture, inside the guest's `captureCommand`). Plain python3/sh scripts from # `tests/`, put on PATH with their shebangs pointing at the store. { runCommandLocal, python3, coreutils, gnugrep, findutils, systemd, }: runCommandLocal "hhstream-test-tools" { nativeBuildInputs = [ python3 ]; # hhs-hyprland-diagnostics runs on a failing guest, where PATH is whatever # systemd left behind; give it the tools it needs explicitly. diagPath = "${coreutils}/bin:${gnugrep}/bin:${findutils}/bin:${systemd}/bin"; meta.description = "Fake capture backend and contract asserter for the hhstream checks"; } '' install -Dm755 ${../../tests/fake_capture.py} $out/bin/hhs-fake-capture install -Dm755 ${../../tests/assert_stream.py} $out/bin/hhs-assert-stream install -Dm755 ${../../tests/hyprland_diagnostics.sh} $out/bin/hhs-hyprland-diagnostics patchShebangs $out/bin substituteInPlace $out/bin/hhs-hyprland-diagnostics --replace-fail '@diagPath@' "$diagPath" # A broken helper shows up as a baffling test failure three layers away, so # prove here that both python programs start and produce what they promise. $out/bin/hhs-fake-capture --width 8 --height 4 > frame.png python3 -c 'import struct,sys; d=open("frame.png","rb").read(); assert d[:8]==b"\x89PNG\r\n\x1a\n", d[:8]; assert struct.unpack(">II", d[16:24])==(8,4), d[16:24]' $out/bin/hhs-assert-stream --help > /dev/null $out/bin/hhs-hyprland-diagnostics --self-test > /dev/null ''