diff --git a/tests/lib2/foo.pc b/tests/lib2/foo.pc new file mode 100644 index 0000000..6491a43 --- /dev/null +++ b/tests/lib2/foo.pc @@ -0,0 +1,10 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: foo +Description: A testing pkg-config file +Version: 1.2.3 +Libs: -L${libdir} -lbar +Cflags: -fPIC -I${includedir}/bar diff --git a/tests/run.sh b/tests/run.sh index 15f5c53..1501b81 100644 --- a/tests/run.sh +++ b/tests/run.sh @@ -48,6 +48,12 @@ run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --exists 'foo > 1.2'; echo \$?" \ run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --exists 'foo > 1.2.3'; echo \$?" \ '1' +# 2) tests for PKG_CONFIG_PATH order +run_test "PKG_CONFIG_PATH=${selfdir}/lib1:${selfdir}/lib2 ${1} --libs foo" \ + '-lfoo' +run_test "PKG_CONFIG_PATH=${selfdir}/lib2:${selfdir}/lib1 ${1} --libs foo" \ + '-lbar' + if [ ${failed} -gt 0 ]; then echo "${failed} of ${done} tests failed. See output for details." >&2 exit 1