Testing
cd cli && cargo test # CLI and shared test vectors
cd cli && cargo test -- --ignored # also the test that talks to GitHub
cd android && ./gradlew :core:test # Kotlin logic; needs only a JDK
cd android && ./gradlew :app:assembleDebug :app:assembleRelease
scripts/check-invariants.sh # permissions, no networking code, no dev code in release
scripts/check-docs.sh # the book builds, and its links resolve
CI runs all of these on every push.
What is tested where
- Kotlin unit tests (
android/core): bundle verification against the shared vectors, the tightening classifier, the delay engine with a fake clock, replay and expiry, waiting changes and phone secrets, the event log chain, the connection protocol (including the phone’sBYE), the USB accessory link over in-memory pipes. - Rust unit tests (
cli): key files, recovery phrases, bundle creation against the shared vectors, config validation and diff, preflight parsers against captured command output, prompts, the USB accessory sync. - Transport parity: the same vectors give the same result over a connection and by file import.
- Device tests (
android/app/src/androidTest, on an emulator): arming and the self-check, policy drift and re-apply, teardown leaving nothing behind, app rules, updates, connecting and the debugging window (adb off after every kind of close, the time limit, a non-shell peer refused), the tamper watch, the PIN screen.
On an emulator
An AOSP image without Google services has no accounts, so the dev build can be made device owner directly. Boot one (the project uses AVDs named quitlock-36 and quitlock-29), then:
ANDROID_HOME=~/Android/Sdk scripts/emulator-test.sh
The script refuses to run against anything that is not an emulator. Emulators have no Chrome and no USB accessory; what they cannot show is in Manual checks.
Developer tools
A dev build has Settings, Developer tools: the app’s state (enrolment, keys, the config in force, the pending action, the connection and debugging window’s inner state), the event log with its chain checked and a filter by kind, and buttons to finish or shorten a countdown, drop the waiting change, end the partner-ready window, clear phone-secret lockouts, and run the self-check, the drift check, policy re-apply and upkeep. They change the dev build’s own state directly, so they are for testing flows quickly, not for checking that the rules hold.