lib/tests: Unify documentation of individual testable files

Changed files
+34 -6
lib
+5 -2
lib/path/tests/prop.sh
···
#!/usr/bin/env bash
-
# Property tests for the `lib.path` library
-
#
+
# Property tests for lib/path/default.nix
# It generates random path-like strings and runs the functions on
# them, checking that the expected laws of the functions hold
+
# Run:
+
# [nixpkgs]$ lib/path/tests/prop.sh
+
# or:
+
# [nixpkgs]$ nix-build lib/tests/release.nix
set -euo pipefail
shopt -s inherit_errexit
+15 -3
lib/tests/misc.nix
···
-
# to run these tests:
-
# nix-instantiate --eval --strict nixpkgs/lib/tests/misc.nix
-
# if the resulting list is empty, all tests passed
+
/*
+
Nix evaluation tests for various lib functions.
+
+
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.
+
If you need to test error messages or more complex evaluations, see ./modules.sh, ./sources.sh or ./filesystem.sh as examples.
+
+
To run these tests:
+
+
[nixpkgs]$ nix-instantiate --eval --strict lib/tests/misc.nix
+
+
If the resulting list is empty, all tests passed.
+
Alternatively, to run all `lib` tests:
+
+
[nixpkgs]$ nix-build lib/tests/release.nix
+
*/
with import ../default.nix;
let
+7 -1
lib/tests/modules.sh
···
#!/usr/bin/env bash
-
#
+
# This script is used to test that the module system is working as expected.
+
# Executing it runs tests for `lib.modules`, `lib.options` and `lib.types`.
# By default it test the version of nixpkgs which is defined in the NIX_PATH.
+
#
+
# Run:
+
# [nixpkgs]$ lib/tests/modules.sh
+
# or:
+
# [nixpkgs]$ nix-build lib/tests/release.nix
set -o errexit -o noclobber -o nounset -o pipefail
shopt -s failglob inherit_errexit
+7
lib/tests/sources.sh
···
#!/usr/bin/env bash
+
+
# Tests lib/sources.nix
+
# Run:
+
# [nixpkgs]$ lib/tests/sources.sh
+
# or:
+
# [nixpkgs]$ nix-build lib/tests/release.nix
+
set -euo pipefail
shopt -s inherit_errexit