Fix wallpaper scan cap exit status
This commit is contained in:
@@ -4,6 +4,7 @@ set -euo pipefail
|
||||
|
||||
repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
service="$repo_dir/config/dot/quickshell/services/Wallpaper.qml"
|
||||
scanner="$repo_dir/config/dot/quickshell/scripts/panama-wallpaper-scan"
|
||||
fixture="$(mktemp -d /tmp/panama-wallpaper-service.XXXXXX)"
|
||||
config_home="$fixture/config"
|
||||
state_home="$fixture/state"
|
||||
@@ -17,6 +18,8 @@ shell_log="$fixture/quickshell.log"
|
||||
harness_pid=""
|
||||
quoted_home="$fixture/home's"
|
||||
quoted_wallpaper="$quoted_home/Pictures/Wallpapers/quoted.jpg"
|
||||
bulk_wallpapers="$fixture/bulk-wallpapers"
|
||||
bulk_segment="wallpaper-root-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
fail() {
|
||||
printf 'wallpaper service contract: %s\n' "$1" >&2
|
||||
@@ -48,10 +51,26 @@ cleanup() {
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
for _ in $(seq 1 15); do
|
||||
bulk_wallpapers="$bulk_wallpapers/$bulk_segment"
|
||||
done
|
||||
mkdir -p "$config_home/panama" "$state_home" "$test_bin" \
|
||||
"$quoted_home/Pictures/Wallpapers"
|
||||
"$quoted_home/Pictures/Wallpapers" "$bulk_wallpapers"
|
||||
cp -a "$repo_dir/config/dot/quickshell" "$config_path"
|
||||
printf 'quoted wallpaper\n' >"$quoted_wallpaper"
|
||||
for index in $(seq 1 401); do
|
||||
wallpaper="$bulk_wallpapers/wallpaper-$index.jpg"
|
||||
printf 'bulk wallpaper %s\n' "$index" >"$wallpaper"
|
||||
touch -d "@$((1700000000 + index))" "$wallpaper"
|
||||
done
|
||||
if ! bulk_scan="$("$scanner" "$bulk_wallpapers")"; then
|
||||
fail 'a normal scan with more than 60 images exited non-zero'
|
||||
fi
|
||||
expected_bulk_scan="$(for index in $(seq 401 -1 342); do
|
||||
printf '%s\n' "$bulk_wallpapers/wallpaper-$index.jpg"
|
||||
done)"
|
||||
[[ "$bulk_scan" == "$expected_bulk_scan" ]] \
|
||||
|| fail "over-cap scan did not emit exactly the newest 60 images: $bulk_scan"
|
||||
cat >"$config_home/panama/settings.json" <<'JSON'
|
||||
{
|
||||
"displays": {
|
||||
|
||||
Reference in New Issue
Block a user