$ PKG_CONFIG_PATH=tests/lib1 ./pkgconf --exists 'foo > 1.2.3'; echo $?
Package foo was not found in the pkg-config search path.
Perhaps you should add the directory containing `foo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'foo' found
1
The message is unclear here. foo.pc actually exists but it is too old. To compare:
$ PKG_CONFIG_PATH=tests/lib1 pkg-config --exists 'foo > 1.2.3'; echo $?
1
+ [OK]