tests: sysroot: add test for sysroot deduplication

If ${pc_sysrootdir} is expanded in another variable, then it
may be included twice.

Ref: https://github.com/pkgconf/pkgconf/issues/307
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
This commit is contained in:
Ariadne Conill 2025-12-20 14:10:14 -08:00
parent 9590e052bb
commit dc0805a3ad

View File

@ -7,6 +7,7 @@ tests_init \
variable \
do_not_eat_slash \
do_not_duplicate_sysroot_dir \
do_not_duplicate_sysroot_dir_variable \
uninstalled \
uninstalled_pkgconf1 \
uninstalled_fdo \
@ -66,6 +67,15 @@ do_not_duplicate_sysroot_dir_body()
pkgconf --cflags sysroot-dir-4
}
do_not_duplicate_sysroot_dir_variable_body()
{
export PKG_CONFIG_SYSROOT_DIR="/sysroot"
atf_check \
-o inline:"/sysroot//usr/share/test\n" \
pkgconf --with-path="${selfdir}/lib1" --variable=pkgdatadir \
explicit-sysroot
}
uninstalled_body()
{
export PKG_CONFIG_PATH="${selfdir}/lib1"