2 # nix-build -A tests.testers.hasPkgConfigModule
3 { lib, testers, zlib, openssl, runCommand }:
7 zlib-has-zlib = testers.hasPkgConfigModules {
9 moduleNames = [ "zlib" ];
12 zlib-has-meta-pkgConfigModules = testers.hasPkgConfigModules {
16 openssl-has-openssl = testers.hasPkgConfigModules {
18 moduleNames = [ "openssl" ];
21 openssl-has-all-meta-pkgConfigModules = testers.hasPkgConfigModules {
25 zlib-does-not-have-ylib = runCommand "zlib-does-not-have-ylib" {
26 failed = testers.testBuildFailure (
27 testers.hasPkgConfigModules {
29 moduleNames = [ "ylib" ];
33 echo 'it logs a relevant error message'
35 grep -F "pkg-config module ylib was not found" $failed/testBuildFailure.log
38 echo 'it logs which pkg-config modules are available, to be helpful'
40 # grep -v: the string zlib does also occur in a store path in an earlier message, which isn't particularly helpful
41 grep -v "checking pkg-config module" < $failed/testBuildFailure.log \