Skip to content

Testing

Qwen4-Max wooo edited this page Nov 27, 2026 · 2 revisions

Testing

The project separates host-agnostic pure-logic unit tests from Linux-only compositor/VM tests (decision D-033). Nothing counts as "working" without evidence: the VM harness gates on a serial marker from the loaded QML shell, not on a compositor process.

Unit tests

Suite Command Covers
Token compiler python3 -m unittest tests.unit.token_compiler_test -v 13 tests: token compilation and accessibility checks
M3 Expressive theme ctest --test-dir build/qml --output-on-failure m3theme: spring motion tokens, shape morph, emphasized type
Terminal emulator ctest (matterminal) VT emulator logic
Calendar ctest (matcal) JSON event persistence
Calculator / text editor run by bash build/build-core-apps.sh Arithmetic parser, document writer
Installer core bash build/test-installer.sh JSON validation, UEFI/BIOS geometry, 4K alignment, capacity and overflow, ext4/Btrfs command generation, password redaction, subprocess I/O, mount rollback. Dry-run only - never touches a real disk
Installer wizard (0.3.0) ctest --test-dir build/matinstall Backend disk filtering, firmware detection, confirmation gating, password redaction; safe-refusal paths only
Workspace control (0.3.0) bash build/test-workspaces.sh Headless compositor + matcompctl: status, workspace switch, next/prev wrap, launch/close, error replies, socket cleanup
Desktop interaction (0.3.0) bash build/test-shell-desktop.sh Real QMouseEvents on the shell: right-click menu, menu launches (stub binaries on PATH), double-click launcher, workspace chips + OSD; then a real Wayland-client smoke under headless matcomp

Integration scripts

bash build/test-compositor.sh       # launches the wlroots compositor
bash build/test-wayland-client.sh   # runs a real Qt/Wayland client under it
bash build/test-new-apps.sh         # every app as a real Wayland client under the headless compositor
bash build/test-theme.sh            # real wallpaper -> light/dark schemes -> QML gallery screenshot
bash build/screenshot-shell.sh      # shell screenshot
bash build/test-installer.sh        # installer safety tests

test-new-apps.sh runs terminal, image viewer, calendar, screenshot, calculator, editor, monitor, files and Settings as real Wayland clients under the headless compositor. test-theme.sh captures its gallery screenshot in build/screenshots/.

VM acceptance harness

bash tests/vm/run-qemu.sh --iso build/iso/materialized-0.2.1-amd64.iso --mode uefi
bash tests/vm/run-qemu.sh --iso build/iso/materialized-0.2.1-amd64.iso --mode bios

What it does:

  1. Boots the hybrid ISO in QEMU (OVMF for UEFI, SeaBIOS for BIOS).
  2. Waits for the Materialized session started marker that the QML shell prints on the serial console only after its window is genuinely exposed. A compositor-only process does not count.
  3. Gates on real input devices being created (keyboard + pointer serial log).
  4. Types a real command into the terminal and gates on its serial output (input-ok) - end-to-end typed-input proof in both firmware modes.
  5. Launches Firefox ESR via Ctrl+Alt+B after the input proof; an in-guest watchdog reports running application processes on the serial log.
  6. Captures screenshots: build/vm/boot-<mode>.png, input-<mode>.png, apps-<mode>.png. Logs land in build/vm/.

Options: --keep-running to inspect the VM, --timeout 300 on slow hosts (300 s is the default). Without /dev/kvm QEMU falls back to slow TCG emulation; run with sudo or add your user to the kvm group for hardware acceleration.

VMware Workstation is exercised separately via build/test-vmware.ps1 (vmrun + VNC remote display) and build/vnc-input-test.py.

Acceptance boundary (Alpha 0.1 definition of done)

  • The unified CMake build succeeds.
  • Token, installer and core-app unit tests pass.
  • A Qt/Wayland client runs under the compositor.
  • The ISO boots to the QML shell in both UEFI and BIOS QEMU.
  • A VM screenshot is captured and inspected.

Alpha 0.2.1 adds the typed-input gate and the VMware boot/input check. See docs/ALPHA-0.2.1.md.

Related pages

Clone this wiki locally