# Linux Kernel Module Cheat

### 11.2. User mode tests

Automatically run all userland tests that can be run in user mode simulation, and check that they exit with status 0:

    ./build --all-archs test-executables-userland
    ./test-executables --all-archs --all-emulators

Or just for QEMU:

    ./build --all-archs test-executables-userland-qemu
    ./test-executables --all-archs --emulator qemu

Source: test-executables

This script skips a manually configured list of tests, notably:

- tests that depend on a full running kernel and cannot be run in user mode simulation, e.g. those that rely on kernel modules

- tests that require user interaction

- tests that take perceptible amounts of time

- known bugs we didn’t have time to fix ;-)

Tests under userland/libs/ are only run if `--package` or `--package-all` are given as described at userland/libs directory.

The gem5 tests require building statically with build id `static`, see also: Section 11.7, “gem5 syscall emulation mode”. TODO automate this better.

See: Section 38.16, “Test this repo” for more useful testing tips.