.github/skills/test-development/SKILL.md
Guide for writing, running, and debugging Nanvix unit, integration, and system tests in Rust and C/C++. Use this when asked about test implementation or failures.
npx skillsauth add nanvix/nanvix test-developmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill when the user asks about writing, running, or debugging tests in Nanvix. Nanvix has unit tests, integration tests, and system tests written in Rust and C/C++.
Unit tests are #[cfg(test)] modules within library crates. They run on the host system using
cargo test.
./z build -- run-unit-tests
Libraries with unit tests are listed in
ALL_GUEST_RUST_LIBS_TEST_LIST: arch, bitmap, config,
elf, error, type-safe, proc, raw-array, slab,
static_assert, libc_string, syslog-macros, syslog.
| Test | Path | Purpose |
|---------------|---------------------------|--------------------|
| testd | src/tests/testd/ | Guest test daemon |
| arch-rust | src/tests/arch-rust/ | Arch tests |
| file-rust | src/tests/file-rust/ | File tests |
| thread-rust | src/tests/thread-rust/ | Thread tests |
| stress-rust | src/tests/stress-rust/ | Stress tests |
| test-kernel | src/tests/test-kernel/ | Kernel tests |
| linux-app | src/tests/linux-app/ | Linux app tests |
System tests run the full Nanvix stack (nanvixd + kernel + guest) and are available only on
microvm and hyperlight machines.
./z build -- run-nanvix-tests
Test configurations:
test/test-single_process.toml — Single-process mode.test/test-multi_process.toml — Multi-process mode.test/test-l2.toml — L2 VM mode.The nanvix-test utility (src/utils/nanvix-test/) drives
these tests in two execution modes:
nanvixd.nanvixd
(native ELF only).Add #[cfg(test)] modules to library crates:
//============================================================
// Tests
//============================================================
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_example() {
let result: u32 = some_function();
assert_eq!(result, 42, "expected 42");
}
}
Rules for tests:
expect() is preferred over unwrap() for better failure diagnostics.#[allow(clippy::unwrap_used)] or #[allow(clippy::expect_used)] at the module level when
needed (the crate uses #![deny(...)]).Guest integration tests are #![no_std] binaries that run inside Nanvix:
src/tests/<name>/.#![no_std], #![no_main]).ALL_GUEST_TESTS in the Makefile.members in root Cargo.toml.# Unit tests + system tests (if applicable).
./z build -- test
# Full CI pipeline (includes all test types).
./scripts/pipeline.sh
testing
Guide for Nanvix CI and GitHub Actions workflow behavior, including local pipeline execution and matrix coverage. Use this when asked about CI checks, workflow failures, or release flow.
development
Guide for developing, building, and running Nanvix user-space applications across supported runtimes and languages. Use this when asked about guest app implementation or execution.
development
Guide for diagnosing Nanvix build, runtime, and test failures, including cleanup and debugging workflows. Use this when asked to investigate errors or unstable behavior.
testing
Guide for running Nanvix tests with z. Use this when asked to run unit tests, integration tests, or the full test suite.