tests: add regression tests for --modversion

Signed-off-by: Colin Gillespie <colin@cgillespie.xyz>
pull/190/head
Colin Gillespie 2023-08-19 11:16:30 +10:00 committed by Ariadne Conill
parent eaa4bb44a0
commit 9cddd22bbc
3 changed files with 44 additions and 0 deletions

12
tests/lib1/foobar.pc Normal file
View File

@ -0,0 +1,12 @@
prefix=/test
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: foobar
Description: A testing pkg-config file
Version: 3.2.1
Libs: -L${libdir} -lfoobar
Cflags: -fPIC -I${includedir}/foobar
Cflags.private: -DFOOBAR_STATIC
License: ISC

View File

@ -0,0 +1,11 @@
prefix=/test
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: unavailable_provider
Description: Provides an otherwise unavailable package
Version: 1.2.3
Provides: unavailable = 1.2.3
Libs: -lunavailable
Cflags:

View File

@ -23,6 +23,9 @@ tests_init \
idirafter_munge_order \ idirafter_munge_order \
idirafter_munge_sysroot \ idirafter_munge_sysroot \
idirafter_ordering \ idirafter_ordering \
modversion_common_prefix \
modversion_fullpath \
modversion_provides \
modversion_uninstalled \ modversion_uninstalled \
pcpath \ pcpath \
virtual_variable \ virtual_variable \
@ -275,6 +278,24 @@ billion_laughs_body()
pkgconf --with-path="${selfdir}/lib1" --validate billion-laughs pkgconf --with-path="${selfdir}/lib1" --validate billion-laughs
} }
modversion_common_prefix_body()
{
atf_check -o inline:"foo: 1.2.3\nfoobar: 3.2.1\n" \
pkgconf --with-path="${selfdir}/lib1" --modversion --verbose foo foobar
}
modversion_fullpath_body()
{
atf_check -o inline:"1.2.3\n" \
pkgconf --modversion "${selfdir}/lib1/foo.pc"
}
modversion_provides_body()
{
atf_check -o inline:"1.2.3\n" \
pkgconf --with-path="${selfdir}/lib1" --modversion unavailable
}
modversion_uninstalled_body() modversion_uninstalled_body()
{ {
atf_check -o inline:"1.2.3\n" \ atf_check -o inline:"1.2.3\n" \