Add tests for 'Requires' and '.private'.

pull/4/head
Michał Górny 2012-05-03 09:15:32 +02:00
parent 482b65f1ce
commit 23e31fd702
3 changed files with 29 additions and 0 deletions

10
tests/lib1/bar.pc Normal file
View File

@ -0,0 +1,10 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: bar
Description: Another pkg-config test
Version: 1.3
Libs: -L${libdir} -lbar
Requires: foo

11
tests/lib1/baz.pc Normal file
View File

@ -0,0 +1,11 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: bar
Description: Another pkg-config test (with private Requires, ha!)
Version: 1.3
Libs: -L${libdir} -lbaz
Libs.private: -L${libdir} -lzee
Requires.private: foo

View File

@ -54,6 +54,14 @@ run_test "PKG_CONFIG_PATH=${selfdir}/lib1:${selfdir}/lib2 ${1} --libs foo" \
run_test "PKG_CONFIG_PATH=${selfdir}/lib2:${selfdir}/lib1 ${1} --libs foo" \
'-lbar'
# 3) tests for 'Requires' and 'Requires.private'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --libs bar" \
'-lfoo' '-lbar'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --libs --cflags baz" \
'-lbaz' '-fPIC' '-I/usr/include/foo'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --static --libs baz" \
'-lfoo -lbaz -lzee'
if [ ${failed} -gt 0 ]; then
echo "${failed} of ${done} tests failed. See output for details." >&2
exit 1