summaryrefslogtreecommitdiff
path: root/docker/scripts/screenshots.sh
diff options
context:
space:
mode:
authorcirakg <cirakg@cirakg.xyz>2026-10-21 03:55:10 +0200
committercirakg <cirakg@cirakg.xyz>2026-10-21 03:55:10 +0200
commit56e0c351bb95cfdf63aa76ab8c5d725a694bad63 (patch)
treee99c7af6eca0656948279055c20a5f87d855d4c8 /docker/scripts/screenshots.sh
parent5e8ac1e2f5a660e55ea132996e1d5730cfa4fa64 (diff)
test(build): add make watchdog, the glance memory budget and the glance screenshot
- make watchdog (in make ci): a stress build encodes, packs, turns into runs and draws the largest code of every 2D symbology at two steps per event on the Forerunner 255S and 70; it fails on a watchdog trip, and the last code left on the screen must decode (bitmap path on the 70). - make memtest checks the glance (DIAG glance, budget 70 % of 64 KB). - screenshots.sh launches the app again after the flow and compares the glance with the favourite's code (glance_code.png on 7 watches); the About goldens show 0.8.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docker/scripts/screenshots.sh')
-rwxr-xr-xdocker/scripts/screenshots.sh33
1 files changed, 32 insertions, 1 deletions
diff --git a/docker/scripts/screenshots.sh b/docker/scripts/screenshots.sh
index 414af52..91477c4 100755
--- a/docker/scripts/screenshots.sh
+++ b/docker/scripts/screenshots.sh
@@ -9,7 +9,9 @@
#
# Uses the UI-test build (uitest.jungle): fake entries, PIN 123456 and a
# frozen clock, so every screenshot is reproducible. tools/ui_flow.py
-# drives the app and checks the screens.
+# drives the app and checks the screens. Then the app is launched again and
+# its glance, which now shows the favourite's code (the first run sealed it),
+# is checked as glance_code.png.
set -euo pipefail
# shellcheck source=ciq-env.sh
source "$(dirname "${BASH_SOURCE[0]}")/ciq-env.sh"
@@ -26,6 +28,34 @@ ciq_start_display
ciq_start_simulator
out="${BUILD_DIR}/screenshots"
+
+# A new launch starts in the glance; screenshot it before anything opens the app.
+shoot_glance() {
+ local device="$1" glance_log="${out}/$1/glance.log"
+ : >"${glance_log}"
+ monkeydo "${BUILD_DIR}/uitest/${device}.prg" "${device}" >>"${glance_log}" 2>&1 &
+ CIQ_MONKEYDO_PID=$!
+ local shown=0
+ for _ in $(seq 1 600); do
+ if grep -q "DIAG shown glance_code" "${glance_log}"; then
+ shown=1
+ break
+ fi
+ sleep 0.05
+ done
+ if ((shown == 0)); then
+ ciq_stop_app
+ log "${device}: the glance with the favourite's code didn't appear; see ${glance_log}"
+ return 1
+ fi
+ sleep 1
+ local status=0
+ python3 /work/tools/ui_flow.py --shot glance_code --device-dir "${CIQ_HOME}/Devices/${device}" \
+ --window "$(ciq_simulator_window)" --out "${out}/${device}" --golden "/work/test/golden/${device}" \
+ "${approve[@]}" || status=1
+ ciq_stop_app
+ return "${status}"
+}
mkdir -p "${out}"
approve=()
[[ "${APPROVE:-0}" == 1 ]] && approve=(--approve)
@@ -43,6 +73,7 @@ for device in "$@"; do
--window "$(ciq_simulator_window)" --out "${out}/${device}" --golden "/work/test/golden/${device}" \
"${approve[@]}" || failed=1
ciq_stop_app
+ shoot_glance "${device}" || failed=1
done
((failed == 0)) || die "screenshot checks failed; see build/screenshots/"