๐งช Testing โ
The testing crate assembles a host integration runtime so tests can run against near-real Core wiring.
Role โ
- Provides one high-level initializer that wires task/users/time, storage, optional graphics, optional networking, and standard streams.
- Reduces per-test boilerplate by mounting known-good baseline devices and hierarchy.
Boundaries โ
- In scope: integration-runtime bootstrap for tests.
- Out of scope: unit-test micro scaffolding and production startup orchestration.
Internal structure โ
lib.rsexposesinitialize(graphics_enabled, network_enabled) -> executable::Standard.- Setup logic is sequential and explicit: logging, managers, VFS root, device mounts, optional subsystems, seed user/account.
Runtime interaction โ
- Initializes core managers (
task,users,time,log). - Optionally starts graphics manager and host window runner tasks.
- Creates memory-backed LittleFS and initializes VFS + default hierarchy.
- Mounts standard devices (
/devices/random,/devices/hasher, stdio, time, null). - Optionally mounts/configures a tuntap network interface and applies IP/routes/DNS.
- Seeds administrator group/user and environment variables (
Paths,Host). - Returns opened
Standardstreams for test/executable launch.
Dependency model โ
- Depends on broad Core surface: file_system, little_fs, authentication, executable, network, graphics, task/users/time/log, plus host drivers.
Failure semantics โ
- Initialization is intentionally strict and uses
unwrap/expectin many places to fail fast in test setup. - Optional branches still fail the initializer if enabled and setup cannot complete.
Extension points โ
- Additional device mounts can be added to the bootstrap sequence for new integration domains.
- Feature toggles can extend the initializer signature if more optional subsystems are needed.
Contract vs implementation โ
- Contract: one async initializer returning ready-to-use
Standardfor executing test binaries/workflows. - Current implementation: host-first initialization with memory-backed LittleFS, optional window/tuntap integration, and seeded administrator account.
Limitations and trade-offs โ
- Fast-fail setup simplifies test diagnosis but is less granular than layered setup APIs.
- Integration realism increases coverage while making initialization heavier than unit-test stubs.