Skip to main content

Crate testing

Crate testing 

Source
Expand description

Minimal std test support for Xila, without platform drivers.

Provides the abstractions tests need (allocator, time, randomness, console, hashing, a headless screen) and initialize (with the environment feature enabled), which sets up a complete in-memory environment. Real drivers (windows, network interfaces, host file systems) belong to platform crates and their integration tests.

Modules§

logger
A logger that prints errors, warnings and information to standard output, and checks that exercise any LoggerTrait implementation.
memory_crate
wifi
Deterministic Wi-Fi control-plane mock (drivers_core::wifi); it never changes the host’s Wi-Fi. Deterministic Wi-Fi control-plane mock. It never changes the host’s Wi-Fi. Pair with a smoltcp packet device and spawn the returned runner explicitly.

Macros§

instantiate_global_allocator
Install MemoryManager as the global allocator and Xila memory manager.

Structs§

Executor
A std executor that Executor::run until Executor::stop is called.
HashDevice
HeadlessScreenDevice
Character device implementing a headless display for host drivers and tests.
Logger
MemoryManager
Xila memory manager for tests: every capability is served by System.
RandomDevice
ThreadAllocations
Allocation counters recorded for a single thread by MemoryManager.
TimeDevice

Enums§

ConsoleDevice
Standard input, output or error of the test process. Never a terminal, so tests behave the same whether or not they run interactively.
HeadlessError
Error returned when creating a HeadlessScreenDevice.
LoadError

Functions§

initialize
Set up an in-memory Xila environment and return the standard streams of the current task: a formatted LittleFS on a memory device, the default hierarchy, test devices, and an administrator user and group.
load_file
Copy a host file into the virtual file system, replacing destination.
new_thread_executor
Start an executor on a new thread and register it with manager.