diff options
| author | Igor Soarez <igor@soarez.org> | 2026-10-05 12:02:45 +0300 |
|---|---|---|
| committer | Igor Soarez <igor@soarez.org> | 2026-10-05 12:02:45 +0300 |
| commit | 10fb1ab5ac9091e59957e97c3e75ea6bc288b8c5 (patch) | |
| tree | 7adca7723f6f5e6d76540df9e9d0a1af3674803e /tmuxrdr/scripts/test-e2e | |
| parent | 2312d3978b7d123968e834c0e0080ad2ff5559df (diff) | |
tmuxrdr: build and run as its own binary beside stock herdr
scripts/build builds the checkout with the pinned toolchains -- Homebrew's
keg-only rustup, Zig 0.16.0 from ~/.local/opt, crates through sfw, Zig's
hash-pinned packages prefetched by Zig since sfw's proxy breaks them -- and
installs it as ~/.local/bin/tmuxrdr. install now sets up tmuxrdr only, in
~/.config/tmuxrdr, and refuses a binary that reads its config elsewhere.
test-e2e tests tmuxrdr and starts with a config check. The config turns off
herdr's update check, whose update would install stock herdr over the fork.
Diffstat (limited to 'tmuxrdr/scripts/test-e2e')
| -rwxr-xr-x | tmuxrdr/scripts/test-e2e | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tmuxrdr/scripts/test-e2e b/tmuxrdr/scripts/test-e2e index 5913afa8..7c82086e 100755 --- a/tmuxrdr/scripts/test-e2e +++ b/tmuxrdr/scripts/test-e2e @@ -13,7 +13,8 @@ # the throwaway pane -- printed, never run -- and is skipped when the # clipboard holds no text. # -# HERDR=path/to/herdr test another binary, e.g. a tmuxrdr build +# HERDR=path/to/binary test another tmuxrdr build than the installed +# tmuxrdr, e.g. target/release/herdr # TMUXRDR_E2E_DELAY=1.2 seconds after each key (default 0.8); raise it on # a loaded machine before suspecting a failure # @@ -22,7 +23,7 @@ set -uo pipefail repo="$(cd "$(dirname "$0")/../.." && pwd -P)" -herdr="${HERDR:-herdr}" +herdr="${HERDR:-tmuxrdr}" delay="${TMUXRDR_E2E_DELAY:-0.8}" session="tmuxrdr-e2e-$$" T=(tmux -L "tmuxrdr-e2e-$$" -f /dev/null) @@ -30,7 +31,7 @@ H=("$herdr" --session "$session") plugin_id="tmuxrdr.tmux-mode" work="$(mktemp -d)" cfg="$work/config.toml" -state="${XDG_STATE_HOME:-$HOME/.local/state}/herdr/plugins/$plugin_id/$session" +state="" # set once the binary's directory name is known, below pass=0 fail=0 skip=0 @@ -49,6 +50,11 @@ die() { >&2 echo "ERROR: $*"; exit 2; } for tool in tmux jq "$herdr"; do command -v "$tool" >/dev/null || die "$tool not found" done +# The binary's own directory name -- tmuxrdr for a tmuxrdr build -- from the +# config path it reports; plugin state lives under the same name. +app="$(basename "$(dirname "$("$herdr" --help | sed -n 's/^Config: *//p')")")" +[[ "$app" == tmuxrdr ]] || die "$herdr keeps its files under '$app', not tmuxrdr: not a tmuxrdr build" +state="${XDG_STATE_HOME:-$HOME/.local/state}/$app/plugins/$plugin_id/$session" "$herdr" plugin list --json 2>/dev/null \ | jq -e --arg id "$plugin_id" --arg root "$repo/tmuxrdr/plugin" \ '[.. | objects | select(.plugin_id? == $id and .plugin_root? == $root)] | length > 0' >/dev/null \ @@ -107,6 +113,9 @@ done [[ "$(focus 2>/dev/null)" == w1:p1 ]] || die "herdr client did not come up" echo "herdr $("$herdr" --version | awk '{print $2}'), session $session, config copy of tmuxrdr/config/config.toml" +check 'config check: no unknown keys or bad bindings' \ + "$(HERDR_CONFIG_PATH="$cfg" "$herdr" config check 2>&1 | head -n 1)" "config: ok" + # --- panes ------------------------------------------------------------------- k C-b %; check 'prefix+% split side by side' "$(tab_panes)" 2 |
