Skip to main content
This guide covers testing procedures for Redox OS, including running tests locally, CI configuration, and automated testing.

Continuous Integration

Redox uses GitLab CI for automated testing on all merge requests targeting the master branch.

CI Pipeline Stages

1

Lint Stage

The lint stage ensures code quality and style compliance.
Checks Rust code formatting:
Run locally:
2

Test Stage

The test stage builds images and validates packaging.
Builds system images:
Run locally:

CI Workflow Rules

The CI pipeline runs automatically when:
  • Commits to master branch in the redox-os namespace
  • Merge requests targeting master

Local Testing

Pre-commit Testing

Before creating a merge request, run these tests locally:
1

Format check

Auto-fix formatting:
2

Run unit tests

3

Build test

4

QEMU test run

Verify the system boots and basic functionality works.

Configuration-based Testing

Redox provides several test configurations:
Standard testing configuration:
Build and test:

CI Image Building

The CI system builds standard images for all architectures:

Build CI Images

This builds three configurations:
  • server - Server configuration
  • desktop - Desktop configuration
  • demo - Demo configuration
Images are created in build/img/$(ARCH)/ with the naming format:
  • redox_<config>_<tag>_harddrive.img.zst
  • redox_<config>_<tag>_livedisk.iso.zst
A SHA256SUM file is also generated for verification.

Customize Image Naming

Individual Configuration Builds

These targets match the filesystem config file names and create images in the IMG_DIR.

OS Testing

Run comprehensive OS-level tests:
1

Clean previous test

2

Run tests in QEMU

3

Extract test results

Test Recipes

Redox includes several test recipes:

Hello World Tests

Multi-language hello world tests in recipes/tests/hello-redox/files/:
  • test.c - C test
  • test.cpp - C++ test
  • test.go - Go test
  • test.java - Java test
  • test.js - JavaScript test
  • test.lua - Lua test
  • test.py - Python test
  • test.rs - Rust test
  • test.zig - Zig test

Automated Testing

The auto-test recipe group includes an Ion script for automated testing:

Testing Specific Components

Test a specific recipe:

Automated Testing in CI

Toolchain Testing

Build and package the toolchain:
This creates:
  • gcc-install.tar.gz
  • relibc-install.tar.gz
  • rust-install.tar.gz
  • clang-install.tar.gz
  • SHA256SUM
In build/toolchain/$(HOST_TARGET)/$(TARGET)/

Multi-Architecture Testing

Test packaging for all architectures:

Regression Testing

1

Identify regression

Note the commit where the issue started.
2

Use git bisect

3

Test each commit

4

Find the culprit

Git bisect will identify the problematic commit.

Performance Testing

Benchmark Configuration

Use the tests configuration with benchmarks:
The tests.toml includes the benchmarks package.

Timing Builds

Test Coverage

Test coverage for Rust code can be generated using cargo-tarpaulin or cargo-llvm-cov.

Testing Best Practices

1

Format code

2

Run tests

3

Build and test

4

Test on multiple configs

Test your changes on all supported architectures:
Vary QEMU settings to catch edge cases:

Troubleshooting Tests

  • Ensure your build environment matches CI (use podman)
  • Check for uncommitted changes
  • Verify dependencies are up-to-date: make pull
  • Clean and rebuild: make clean && make all
  • Check CI logs for specific errors
  • Verify all files are committed
  • Ensure no local-only configuration
  • Test with PODMAN_BUILD=0 like CI does
  • May be timing-related (try kvm=no)
  • Check for race conditions
  • Test with different QEMU_SMP values
  • Review serial logs: make qemu serial=yes qemu_serial_logfile=test.log

Additional Resources

CI Configuration

View the complete CI configuration

Developer FAQ

Common testing questions

Debugging Guide

Debug failing tests

Build System Reference

Complete build system documentation

Next Steps

Contributing Guide

Review contribution guidelines

Development Workflow

Learn the development process