From 5f168493c571b70ba41cd2d34a635fafe0e1e693 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Mon, 23 Jul 2012 20:53:20 -0500 Subject: [PATCH] tests: add tests for dpkg-style tilde version comparison rules --- tests/lib1/tilde.pc | 11 +++++++++++ tests/run.sh.in | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/lib1/tilde.pc diff --git a/tests/lib1/tilde.pc b/tests/lib1/tilde.pc new file mode 100644 index 0000000..10e8db0 --- /dev/null +++ b/tests/lib1/tilde.pc @@ -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} diff --git a/tests/run.sh.in b/tests/run.sh.in index 8e01c9b..8bec59a 100644 --- a/tests/run.sh.in +++ b/tests/run.sh.in @@ -63,6 +63,12 @@ run_test "${1} --modversion ${selfdir}/lib1/foo.pc" \ '1.2.3' run_test "PKG_CONFIG_PATH=${selfdir}/lib1 ${1} --exists 'foo >= '; echo \$?" \ '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 run_test "PKG_CONFIG_PATH=${selfdir}/lib1:${selfdir}/lib2 ${1} --libs foo" \