tests: add tests for 'conflicts' field (issue #13)

pull/29/head
William Pitcock 2012-05-11 20:32:32 -05:00
parent 0aa05d3e66
commit 948e219075
2 changed files with 17 additions and 0 deletions

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

@ -0,0 +1,11 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: conflicts
Description: A testing pkg-config file
Conflicts: foo <= 1.3
Version: 1.2.3
Libs: -L${libdir} -lconflicts
Cflags: -fPIC -I${includedir}/conflicts

View File

@ -92,6 +92,12 @@ run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --define-variable=prefix=/test --
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 PKG_CONFIG_SYSROOT_DIR=/test ${1} --cflags baz" \ run_test "PKG_CONFIG_PATH=${selfdir}/lib1 PKG_CONFIG_SYSROOT_DIR=/test ${1} --cflags baz" \
'-I/test/usr/include/foo' '-I/test/usr/include/foo'
# 8) tests for 'Conflicts'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --libs conflicts; echo \$?" \
'1'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --ignore-conflicts --libs conflicts; echo \$?" \
'-lconflicts' '0'
if [ ${failed} -gt 0 ]; then if [ ${failed} -gt 0 ]; then
echo "${failed} of ${done} tests failed. See output for details." >&2 echo "${failed} of ${done} tests failed. See output for details." >&2
exit 1 exit 1