forked from ariadne/pkgconf
add test for symlinked ${pcfiledir}
parent
e6c1d4b8bd
commit
ff51052e1c
|
@ -73,6 +73,7 @@ core
|
||||||
/tests/provides
|
/tests/provides
|
||||||
/tests/regress
|
/tests/regress
|
||||||
/tests/requires
|
/tests/requires
|
||||||
|
/tests/symlink
|
||||||
/tests/sysroot
|
/tests/sysroot
|
||||||
/tests/test_env.sh
|
/tests/test_env.sh
|
||||||
/tests/version
|
/tests/version
|
||||||
|
|
|
@ -107,6 +107,7 @@ EXTRA_DIST = pkg.m4 \
|
||||||
tests/lib1/tuple-quoting.pc \
|
tests/lib1/tuple-quoting.pc \
|
||||||
tests/lib1/empty-tuple.pc \
|
tests/lib1/empty-tuple.pc \
|
||||||
tests/lib1/orphaned-requires-private.pc \
|
tests/lib1/orphaned-requires-private.pc \
|
||||||
|
tests/lib1/pcfiledir.pc \
|
||||||
tests/lib1/sysroot-dir-2.pc \
|
tests/lib1/sysroot-dir-2.pc \
|
||||||
tests/lib1/sysroot-dir-3.pc \
|
tests/lib1/sysroot-dir-3.pc \
|
||||||
tests/lib1/sysroot-dir-4.pc \
|
tests/lib1/sysroot-dir-4.pc \
|
||||||
|
@ -137,6 +138,7 @@ test_scripts= tests/meson.build \
|
||||||
tests/provides.sh \
|
tests/provides.sh \
|
||||||
tests/regress.sh \
|
tests/regress.sh \
|
||||||
tests/requires.sh \
|
tests/requires.sh \
|
||||||
|
tests/symlink.sh \
|
||||||
tests/sysroot.sh \
|
tests/sysroot.sh \
|
||||||
tests/version.sh
|
tests/version.sh
|
||||||
|
|
||||||
|
|
|
@ -11,3 +11,4 @@ atf_test_program{name='conflicts'}
|
||||||
atf_test_program{name='version'}
|
atf_test_program{name='version'}
|
||||||
atf_test_program{name='framework'}
|
atf_test_program{name='framework'}
|
||||||
atf_test_program{name='provides'}
|
atf_test_program{name='provides'}
|
||||||
|
atf_test_program{name='symlink'}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
prefix=${pcfiledir}
|
||||||
|
exec_prefix=${prefix}
|
||||||
|
libdir=${prefix}/lib
|
||||||
|
includedir=${prefix}/include
|
||||||
|
|
||||||
|
Name: foo
|
||||||
|
Description: A testing pkg-config file with a ${pcfiledir}
|
||||||
|
Version: 1.2.3
|
|
@ -11,8 +11,9 @@ tests = [
|
||||||
'provides',
|
'provides',
|
||||||
'regress',
|
'regress',
|
||||||
'requires',
|
'requires',
|
||||||
|
'symlink',
|
||||||
'sysroot',
|
'sysroot',
|
||||||
'version'
|
'version',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,122 @@
|
||||||
|
#!/usr/bin/env atf-sh
|
||||||
|
|
||||||
|
. $(atf_get_srcdir)/test_env.sh
|
||||||
|
|
||||||
|
tests_init \
|
||||||
|
pcfiledir_symlink_absolute \
|
||||||
|
pcfiledir_symlink_relative
|
||||||
|
|
||||||
|
# - We need to create a temporary subtree, since symlinks are not preserved
|
||||||
|
# in "make dist".
|
||||||
|
# - ${srcdir} is relative and since we need to compare paths, we would have
|
||||||
|
# to portably canonicalize it again, which is hard. Instead, just keep
|
||||||
|
# the whole thing nested.
|
||||||
|
pcfiledir_symlink_absolute_body()
|
||||||
|
{
|
||||||
|
mkdir -p tmp/child
|
||||||
|
cp -f "${selfdir}/lib1/pcfiledir.pc" tmp/child/
|
||||||
|
ln -f -s "${PWD}/tmp/child/pcfiledir.pc" tmp/pcfiledir.pc # absolute
|
||||||
|
ln -f -s tmp/pcfiledir.pc pcfiledir.pc
|
||||||
|
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir.pc
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix tmp/pcfiledir.pc
|
||||||
|
atf_check \
|
||||||
|
-o inline:"tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix tmp/child/pcfiledir.pc
|
||||||
|
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix "${PWD}/pcfiledir.pc"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix "${PWD}/tmp/pcfiledir.pc"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix "${PWD}/tmp/child/pcfiledir.pc"
|
||||||
|
|
||||||
|
export PKG_CONFIG_PATH="."
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
export PKG_CONFIG_PATH="${PWD}"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
|
||||||
|
export PKG_CONFIG_PATH="tmp"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
export PKG_CONFIG_PATH="${PWD}/tmp"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
|
||||||
|
export PKG_CONFIG_PATH="tmp/child"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
export PKG_CONFIG_PATH="${PWD}/tmp/child"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
}
|
||||||
|
|
||||||
|
pcfiledir_symlink_relative_body()
|
||||||
|
{
|
||||||
|
mkdir -p tmp/child
|
||||||
|
cp -f "${selfdir}/lib1/pcfiledir.pc" tmp/child/
|
||||||
|
ln -f -s child/pcfiledir.pc tmp/pcfiledir.pc # relative
|
||||||
|
ln -f -s tmp/pcfiledir.pc pcfiledir.pc
|
||||||
|
|
||||||
|
atf_check \
|
||||||
|
-o inline:"tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir.pc
|
||||||
|
atf_check \
|
||||||
|
-o inline:"tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix tmp/pcfiledir.pc
|
||||||
|
atf_check \
|
||||||
|
-o inline:"tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix tmp/child/pcfiledir.pc
|
||||||
|
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix "${PWD}/pcfiledir.pc"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix "${PWD}/tmp/pcfiledir.pc"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix "${PWD}/tmp/child/pcfiledir.pc"
|
||||||
|
|
||||||
|
export PKG_CONFIG_PATH="."
|
||||||
|
atf_check \
|
||||||
|
-o inline:"tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
export PKG_CONFIG_PATH="${PWD}"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
|
||||||
|
export PKG_CONFIG_PATH="tmp"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
export PKG_CONFIG_PATH="${PWD}/tmp"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
|
||||||
|
export PKG_CONFIG_PATH="tmp/child"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
export PKG_CONFIG_PATH="${PWD}/tmp/child"
|
||||||
|
atf_check \
|
||||||
|
-o inline:"${PWD}/tmp/child\n" \
|
||||||
|
pkgconf --variable=prefix pcfiledir
|
||||||
|
}
|
Loading…
Reference in New Issue