Skip to content

9 Testing, CI and Debugging

Glen edited this page Nov 14, 2026 · 2 revisions

Testing, CI and Debugging

Relevant source files

CadenzaOS provides a structured quality assurance pipeline combining automated continuous integration, headless QEMU smoke assertions, kernel-level exception validation, and serial diagnostics. This parent page outlines the testing framework and debugging mechanisms across the codebase.

For deep technical details, see the child pages:

Title: CI and Smoke Pipeline Architecture

diagram

Sources: .github/workflows/smoke.yml1-32tests/smoke.sh1-206


9.1 Smoke Tests and GitHub Actions

Automated regression testing ensures that changes do not break core boot sequencing, command execution, or filesystem operations. The continuous integration pipeline runs on every push and pull request via GitHub Actions .github/workflows/smoke.yml1-3 It provisions an Ubuntu environment, installs build prerequisites including NASM, QEMU, and Zig, and builds the disk image using ./build.sh ci.github/workflows/smoke.yml15-23

The smoke test harness (tests/smoke.sh) executes a two-stage verification process:

  1. Stage 1 (Boot Assertion): Boots the kernel headlessly in QEMU and waits for the Cadenza /> prompt to appear on the serial log tests/smoke.sh4-122
  2. Stage 2 (Interactive Commands): Connects to the QEMU TCP monitor interface to type shell commands (spawn, touch, del) and asserts expected outputs on the serial stream tests/smoke.sh5-206 The script also includes checks for directory operations like mkdir and mvtests/smoke.sh178-204 and verifies user interaction with prompts, such as the confirmation for deltests/smoke.sh160-166

Additionally, the kernel implements standalone validation and fault-triggering functions in src/kernel/tests.zig to verify exception handlers and allocator resilience src/kernel/tests.zig1-183 System requirements and dependency versions are documented in DEPENDENCIES.md:1-72().

For complete implementation details, workflow configurations, and unit test routines, see Smoke Tests and GitHub Actions.

Sources: .github/workflows/smoke.yml1-32tests/smoke.sh1-206src/kernel/ui/prompt.zig1-53src/kernel/tests.zig1-183DEPENDENCIES.md1-71


9.2 Panic Handling and Debug Tooling

When runtime faults, memory errors, or unrecoverable assertions occur, CadenzaOS relies on robust panic handling and diagnostic tracing infrastructure. Kernel fault tests intentionally trigger processor exceptions—such as divide-by-zero, breakpoints (int3), invalid opcodes (ud2), general protection faults, and page faults—to ensure that CPU exception vectors and interrupt handlers dispatch correctly src/kernel/tests.zig21-84

Title: Exception Dispatch and Diagnostic Flow

diagram

Sources: src/kernel/tests.zig21-84tests/smoke.sh58-61

Diagnostic tooling includes serial-based logging, memory map verification (e820_test), and emulator support configurations. For full documentation on panic routines, stack tracing, and debugging environments, see Panic Handling and Debug Tooling.

Sources: src/kernel/tests.zig21-84tests/smoke.sh58-61DEPENDENCIES.md26-32

Clone this wiki locally