From 482b65f1ceaee5be70b205e3867d577ad11700f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 3 May 2012 09:04:48 +0200 Subject: [PATCH] Tests for PKG_CONFIG_PATH ordering. --- tests/lib2/foo.pc | 10 ++++++++++ tests/run.sh | 6 ++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/lib2/foo.pc 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