Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Testing

From the repository’s root; each line can be pasted on its own or all together:

(cd desktop && cargo test --workspace)                        # library, CLI, desktop app and shared test vectors
(cd desktop && cargo test --workspace -- --include-ignored)   # also the two tests that use the network (GitHub, a DNS filter)
(cd desktop && cargo deny check)                              # advisories, licences, banned crates
(cd android && ./gradlew :core:test)                          # Kotlin logic; needs only a JDK
(cd android && ./gradlew :app:assembleDebug :app:assembleQa :app:assembleRelease)
scripts/check-invariants.sh                                   # permissions, no networking code, no dev code in release
scripts/check-docs.sh                                         # the book builds, its links resolve, every page is listed

CI runs all of these, except the two network tests, on every push to main and dev and on pull requests; the desktop tests run on Linux and Windows.

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’s BYE), the USB accessory link over in-memory pipes.
  • Rust unit tests (desktop): 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.