about summary refs log tree commit diff
path: root/doc/builders
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2023-08-08 12:51:22 +0200
committersternenseemann <sternenseemann@systemli.org>2023-08-08 19:16:48 +0200
commitaf60e68744fc34d61766d1bf0b58fc0cc6aa11de (patch)
treebb2ae50ee2565ba898e2702f4de305057bceff3e /doc/builders
parentf1dc41a5cd467b19b7699b9fbd9d18286c891ff6 (diff)
downloadnixlib-af60e68744fc34d61766d1bf0b58fc0cc6aa11de.tar
nixlib-af60e68744fc34d61766d1bf0b58fc0cc6aa11de.tar.gz
nixlib-af60e68744fc34d61766d1bf0b58fc0cc6aa11de.tar.bz2
nixlib-af60e68744fc34d61766d1bf0b58fc0cc6aa11de.tar.lz
nixlib-af60e68744fc34d61766d1bf0b58fc0cc6aa11de.tar.xz
nixlib-af60e68744fc34d61766d1bf0b58fc0cc6aa11de.tar.zst
nixlib-af60e68744fc34d61766d1bf0b58fc0cc6aa11de.zip
testers.hasPkgConfigModules: allow checking multiple pkg-config mods
This is very useful in conjunction with meta.pkgConfigModules, as the
new tester can use the list provided by this meta attribute as a default
value for moduleNames, making its usage in passthru.tests very
convenient.

For backwards compatibility, a shim under the old name is maintained
with a warning.
Diffstat (limited to 'doc/builders')
-rw-r--r--doc/builders/testers.chapter.md24
1 files changed, 19 insertions, 5 deletions
diff --git a/doc/builders/testers.chapter.md b/doc/builders/testers.chapter.md
index fb6a28b7ee4b..b2a581c3dd8d 100644
--- a/doc/builders/testers.chapter.md
+++ b/doc/builders/testers.chapter.md
@@ -1,17 +1,31 @@
 # Testers {#chap-testers}
 This chapter describes several testing builders which are available in the `testers` namespace.
 
-## `hasPkgConfigModule` {#tester-hasPkgConfigModule}
+## `hasPkgConfigModules` {#tester-hasPkgConfigModules}
 
-Checks whether a package exposes a certain `pkg-config` module.
+<!-- Old anchor name so links still work -->
+[]{#tester-hasPkgConfigModule}
+Checks whether a package exposes a given list of `pkg-config` modules.
+If the `moduleNames` argument is omitted, `hasPkgConfigModules` will
+use `meta.pkgConfigModules`.
 
 Example:
 
 ```nix
-passthru.tests.pkg-config = testers.hasPkgConfigModule {
+passthru.tests.pkg-config = testers.hasPkgConfigModules {
   package = finalAttrs.finalPackage;
-  moduleName = "libfoo";
-}
+  moduleNames = [ "libfoo" ];
+};
+```
+
+If the package in question has `meta.pkgConfigModules` set, it is even simpler:
+
+```nix
+passthru.tests.pkg-config = testers.hasPkgConfigModules {
+  package = finalAttrs.finalPackage;
+};
+
+meta.pkgConfigModules = [ "libfoo" ];
 ```
 
 ## `testVersion` {#tester-testVersion}