about summary refs log tree commit diff
path: root/lib/tests
diff options
context:
space:
mode:
authorSilvan Mosberger <silvan.mosberger@tweag.io>2023-07-18 17:20:28 +0200
committerSilvan Mosberger <silvan.mosberger@tweag.io>2023-07-18 17:22:45 +0200
commit581d7c88bea4216fb47c2a98f38af59f2d14485d (patch)
treef954f31b7bac5fb2681c0d19552dab3272303a1b /lib/tests
parent03431f1244a92659cf26a1b6e40de5db00c5e310 (diff)
lib/tests: Unify documentation of individual testable files
Diffstat (limited to 'lib/tests')
-rw-r--r--lib/tests/misc.nix18
-rwxr-xr-xlib/tests/modules.sh8
-rwxr-xr-xlib/tests/sources.sh7
3 files changed, 29 insertions, 4 deletions
diff --git a/lib/tests/misc.nix b/lib/tests/misc.nix
index 231f19c513eb2..6dc0d391fb4b0 100644
--- a/lib/tests/misc.nix
+++ b/lib/tests/misc.nix
@@ -1,6 +1,18 @@
-# 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
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh
index 7aebba6b589eb..5c596b5a6687d 100755
--- a/lib/tests/modules.sh
+++ b/lib/tests/modules.sh
@@ -1,7 +1,13 @@
 #!/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
diff --git a/lib/tests/sources.sh b/lib/tests/sources.sh
index cda77aa96b288..079c7eea56574 100755
--- a/lib/tests/sources.sh
+++ b/lib/tests/sources.sh
@@ -1,4 +1,11 @@
 #!/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