1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-08 20:29:43 +01:00
home-manager/docs/manual/contributing/tests.md
Viktor Kronvall 69a96783b1 docs: render without deprecated optionsDocBook
The `optionsDocBook` function is deprecated in nixpkgs since
nixos-23.11. This commit updates the manual and manpages to
use commonmark formatted documentation instead of the deprecated
docbook format.
2023-12-09 01:06:44 +09:00

38 lines
1.1 KiB
Markdown

# Tests {#sec-tests}
Home Manager includes a basic test suite and it is highly recommended to
include at least one test when adding a module. Tests are typically in
the form of \"golden tests\" where, for example, a generated
configuration file is compared to a known correct file.
It is relatively easy to create tests by modeling the existing tests,
found in the `tests` project directory. For a full reference to the
functions available in test scripts, you can look at NMT's
[bash-lib](https://git.sr.ht/~rycee/nmt/tree/master/item/bash-lib).
The full Home Manager test suite can be run by executing
``` console
$ nix-shell --pure tests -A run.all
```
in the project root. List all test cases through
``` console
$ nix-shell --pure tests -A list
```
and run an individual test, for example `alacritty-empty-settings`,
through
``` console
$ nix-shell --pure tests -A run.alacritty-empty-settings
```
However, those invocations will impurely source the system's nixpkgs,
and may cause failures. To run against the nixpkgs from the flake.lock,
use instead e.g.
``` console
$ nix develop --ignore-environment .#all
```