nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/tests: Unify documentation of individual testable files

+34 -6
+5 -2
lib/path/tests/prop.sh
··· 1 1 #!/usr/bin/env bash 2 2 3 - # Property tests for the `lib.path` library 4 - # 3 + # Property tests for lib/path/default.nix 5 4 # It generates random path-like strings and runs the functions on 6 5 # them, checking that the expected laws of the functions hold 6 + # Run: 7 + # [nixpkgs]$ lib/path/tests/prop.sh 8 + # or: 9 + # [nixpkgs]$ nix-build lib/tests/release.nix 7 10 8 11 set -euo pipefail 9 12 shopt -s inherit_errexit
+15 -3
lib/tests/misc.nix
··· 1 - # to run these tests: 2 - # nix-instantiate --eval --strict nixpkgs/lib/tests/misc.nix 3 - # if the resulting list is empty, all tests passed 1 + /* 2 + Nix evaluation tests for various lib functions. 3 + 4 + Since these tests are implemented with Nix evaluation, error checking is limited to what `builtins.tryEval` can detect, which is `throw`'s and `abort`'s, without error messages. 5 + If you need to test error messages or more complex evaluations, see ./modules.sh, ./sources.sh or ./filesystem.sh as examples. 6 + 7 + To run these tests: 8 + 9 + [nixpkgs]$ nix-instantiate --eval --strict lib/tests/misc.nix 10 + 11 + If the resulting list is empty, all tests passed. 12 + Alternatively, to run all `lib` tests: 13 + 14 + [nixpkgs]$ nix-build lib/tests/release.nix 15 + */ 4 16 with import ../default.nix; 5 17 6 18 let
+7 -1
lib/tests/modules.sh
··· 1 1 #!/usr/bin/env bash 2 - # 2 + 3 3 # This script is used to test that the module system is working as expected. 4 + # Executing it runs tests for `lib.modules`, `lib.options` and `lib.types`. 4 5 # By default it test the version of nixpkgs which is defined in the NIX_PATH. 6 + # 7 + # Run: 8 + # [nixpkgs]$ lib/tests/modules.sh 9 + # or: 10 + # [nixpkgs]$ nix-build lib/tests/release.nix 5 11 6 12 set -o errexit -o noclobber -o nounset -o pipefail 7 13 shopt -s failglob inherit_errexit
+7
lib/tests/sources.sh
··· 1 1 #!/usr/bin/env bash 2 + 3 + # Tests lib/sources.nix 4 + # Run: 5 + # [nixpkgs]$ lib/tests/sources.sh 6 + # or: 7 + # [nixpkgs]$ nix-build lib/tests/release.nix 8 + 2 9 set -euo pipefail 3 10 shopt -s inherit_errexit 4 11