tests: add tests for dpkg-style tilde version comparison rules

pull/29/head
William Pitcock 2012-07-23 20:53:20 -05:00
parent 72f9e90f27
commit 5f168493c5
2 changed files with 17 additions and 0 deletions

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

@ -0,0 +1,11 @@
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
Name: Tilde version test
Description: Test package for checking rpmvercmp ~ handling
Version: 1.0.0~rc1
Requires:
Libs: -L${libdir} -ltilde
Cflags: -I${includedir}

View File

@ -63,6 +63,12 @@ run_test "${1} --modversion ${selfdir}/lib1/foo.pc" \
'1.2.3' '1.2.3'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --exists 'foo >= '; echo \$?" \ run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --exists 'foo >= '; echo \$?" \
'1' '1'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --exists 'tilde <= 1.0.0'; echo \$?" \
'0'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --exists 'tilde = 1.0.0~rc1'; echo \$?" \
'0'
run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --exists 'tilde >= 1.0.0'; echo \$?" \
'1'
# 2) tests for PKG_CONFIG_PATH order # 2) tests for PKG_CONFIG_PATH order
run_test "PKG_CONFIG_PATH=${selfdir}/lib1:${selfdir}/lib2 ${1} --libs foo" \ run_test "PKG_CONFIG_PATH=${selfdir}/lib1:${selfdir}/lib2 ${1} --libs foo" \