testsAndMisc/phone_focus_mode/lib/tests
Krzysztof kuhy Rudnicki 61be666329
Some checks are pending
Pre-commit checks / pre-commit (push) Waiting to run
Shell tests / shell-tests (push) Waiting to run
Shell tests / arch-tests (push) Waiting to run
phone_backup: split 333 -> 229 + 114, with the library at 100%
The capture half -- dump_packages, pull_apks, pull_sdcard, dump_settings
and dump_focus_state -- moves into lib/backup_capture.sh. SDCARD_DIRS goes
with pull_sdcard, its only reader: left behind it would be a global the
entry script never reads (SC2034), and the hook runs shellcheck without -x
so each file has to stand alone.

This code decides what a phone backup actually contains and had no test at
all. It has one now, against a fake device mocking adb_cmd -- the single
boundary all five functions cross. 22 assertions, 52/52 lines, and 13
mutations all killed. One of those mutations reintroduces the stdin-
draining bug pull_apks' own comment documents (it pulled 1 of 54 packages
before it was fixed); the suite catches it.

Nine of the ten functions moved verbatim per verify_shell_split.sh.
dump_focus_state is the exception and the tool correctly says so: its
`{ ... } >file` group hid a line kcov instruments but bash never reports,
and rewriting it as individual redirects drew SC2129 instead. One printf
satisfies both. Its rendered focus-state.md was diffed against HEAD's
output on the same inputs -- byte-identical.

Same for three multi-line literals (SDCARD_DIRS and two mapfile process
substitutions), which were stuck at 1/N covered for the same reason.

phone_backup.sh is PC-side and in neither deploy list, so no list edits.
--help exits 0; --verify on an empty dir exits 1 naming the four missing
files, matching HEAD exactly. Over-cap count 22 -> 21.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
2026-08-17 16:02:25 +02:00
..
adb_test_harness.sh phone_focus_mode: split test_adb_common.sh 287 -> 134 + 105 2026-08-17 10:34:55 +02:00
backup_capture_harness.sh phone_backup: split 333 -> 229 + 114, with the library at 100% 2026-08-17 16:02:25 +02:00
dns_iptables_harness.sh meta: measurable shell coverage, and dns_iptables.sh at 100% 2026-08-17 15:29:08 +02:00
monitor_cases_health.sh monitor: backfill to 100% coverage, fixing two defects it exposed 2026-08-17 15:54:04 +02:00
monitor_cases_policy.sh monitor: backfill to 100% coverage, fixing two defects it exposed 2026-08-17 15:54:04 +02:00
monitor_harness.sh monitor: backfill to 100% coverage, fixing two defects it exposed 2026-08-17 15:54:04 +02:00
test_adb_common.sh phone_focus_mode: split test_adb_common.sh 287 -> 134 + 105 2026-08-17 10:34:55 +02:00
test_adb_trusted.sh phone_focus_mode: split test_adb_common.sh 287 -> 134 + 105 2026-08-17 10:34:55 +02:00
test_backup_capture.sh phone_backup: split 333 -> 229 + 114, with the library at 100% 2026-08-17 16:02:25 +02:00
test_dns_iptables.sh meta: measurable shell coverage, and dns_iptables.sh at 100% 2026-08-17 15:29:08 +02:00
test_magisk_service.sh feat(phone-focus): add recovery workflow, automation scripts, and docs 2026-05-01 19:07:27 +02:00
test_monitor.sh monitor: backfill to 100% coverage, fixing two defects it exposed 2026-08-17 15:54:04 +02:00
test_tether_enforcer.sh tether_enforcer: split 267 -> 182 + 103, and grow both deploy lists 2026-08-17 14:38:53 +02:00