diff options
author | sternenseemann <sternenseemann@systemli.org> | 2023-08-08 12:51:22 +0200 |
---|---|---|
committer | sternenseemann <sternenseemann@systemli.org> | 2023-08-08 19:16:48 +0200 |
commit | af60e68744fc34d61766d1bf0b58fc0cc6aa11de (patch) | |
tree | bb2ae50ee2565ba898e2702f4de305057bceff3e /doc/builders | |
parent | f1dc41a5cd467b19b7699b9fbd9d18286c891ff6 (diff) |
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.md | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/doc/builders/testers.chapter.md b/doc/builders/testers.chapter.md index fb6a28b7ee4b2..b2a581c3dd8d9 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} |