2016-09-18 20:48:13 +00:00
|
|
|
#!/usr/bin/env atf-sh
|
|
|
|
|
|
|
|
. $(atf_get_srcdir)/test_env.sh
|
|
|
|
|
|
|
|
tests_init \
|
|
|
|
libs \
|
|
|
|
libs_cflags \
|
|
|
|
libs_static \
|
2016-11-16 05:03:50 +00:00
|
|
|
libs_static_pure \
|
2016-09-18 20:48:13 +00:00
|
|
|
argv_parse2 \
|
|
|
|
static_cflags \
|
|
|
|
private_duplication \
|
2024-01-17 17:28:38 +00:00
|
|
|
private_duplication_digraph \
|
2016-09-18 20:48:13 +00:00
|
|
|
libs_static2 \
|
2018-03-18 20:46:53 +00:00
|
|
|
missing \
|
|
|
|
requires_internal \
|
2018-03-19 00:03:18 +00:00
|
|
|
requires_internal_missing \
|
2019-01-14 20:07:19 +00:00
|
|
|
requires_internal_collision \
|
|
|
|
orphaned_requires_private
|
2016-09-18 20:48:13 +00:00
|
|
|
|
|
|
|
libs_body()
|
|
|
|
{
|
|
|
|
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
|
|
|
atf_check \
|
2023-01-21 20:22:03 +00:00
|
|
|
-o inline:"-L/test/lib -lbar -lfoo\n" \
|
2016-09-18 20:48:13 +00:00
|
|
|
pkgconf --libs bar
|
|
|
|
}
|
|
|
|
|
|
|
|
libs_cflags_body()
|
|
|
|
{
|
|
|
|
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
|
|
|
atf_check \
|
2023-01-21 20:22:03 +00:00
|
|
|
-o inline:"-fPIC -I/test/include/foo -L/test/lib -lbaz\n" \
|
2016-09-18 20:48:13 +00:00
|
|
|
pkgconf --libs --cflags baz
|
|
|
|
}
|
|
|
|
|
|
|
|
libs_static_body()
|
|
|
|
{
|
|
|
|
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
|
|
|
atf_check \
|
2023-01-21 20:22:03 +00:00
|
|
|
-o inline:"-L/test/lib -lbaz -L/test/lib -lzee -L/test/lib -lfoo\n" \
|
2016-09-18 20:48:13 +00:00
|
|
|
pkgconf --static --libs baz
|
|
|
|
}
|
|
|
|
|
2016-11-16 05:03:50 +00:00
|
|
|
libs_static_pure_body()
|
|
|
|
{
|
|
|
|
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
|
|
|
atf_check \
|
2023-01-21 20:22:03 +00:00
|
|
|
-o inline:"-L/test/lib -lbaz -L/test/lib -lfoo\n" \
|
2016-11-16 05:03:50 +00:00
|
|
|
pkgconf --static --pure --libs baz
|
|
|
|
}
|
|
|
|
|
2016-09-18 20:48:13 +00:00
|
|
|
argv_parse2_body()
|
|
|
|
{
|
|
|
|
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
|
|
|
atf_check \
|
2023-01-21 20:22:03 +00:00
|
|
|
-o inline:"-llib-1 -pthread /test/lib/lib2.so\n" \
|
2016-09-18 20:48:13 +00:00
|
|
|
pkgconf --static --libs argv-parse-2
|
|
|
|
}
|
|
|
|
|
|
|
|
static_cflags_body()
|
|
|
|
{
|
|
|
|
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
|
|
|
atf_check \
|
2023-01-21 20:22:03 +00:00
|
|
|
-o inline:"-fPIC -I/test/include/foo -DFOO_STATIC\n" \
|
2016-09-18 20:48:13 +00:00
|
|
|
pkgconf --static --cflags baz
|
|
|
|
}
|
|
|
|
|
|
|
|
private_duplication_body()
|
|
|
|
{
|
|
|
|
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
|
|
|
atf_check \
|
2023-01-21 21:43:23 +00:00
|
|
|
-o inline:"-lprivate -lbaz -lzee -lbar -lfoo -lfoo\n" \
|
2016-09-18 20:48:13 +00:00
|
|
|
pkgconf --static --libs-only-l private-libs-duplication
|
|
|
|
}
|
2024-01-17 17:28:38 +00:00
|
|
|
|
|
|
|
private_duplication_digraph_body()
|
|
|
|
{
|
|
|
|
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
|
|
|
atf_check \
|
2024-03-18 07:37:17 +00:00
|
|
|
-o 'match:"user:request" -> "private-libs-duplication"' \
|
2024-01-17 17:28:38 +00:00
|
|
|
-o 'match:"private-libs-duplication" -> "bar"' \
|
|
|
|
-o 'match:"private-libs-duplication" -> "baz"' \
|
|
|
|
-o 'match:"bar" -> "foo"' \
|
|
|
|
-o 'match:"baz" -> "foo"' \
|
|
|
|
pkgconf --static --libs-only-l private-libs-duplication --digraph
|
|
|
|
}
|
2016-09-18 20:48:13 +00:00
|
|
|
|
|
|
|
libs_static2_body()
|
|
|
|
{
|
|
|
|
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
|
|
|
atf_check \
|
2023-01-21 20:22:03 +00:00
|
|
|
-o inline:"-lbar -lbar-private -L/test/lib -lfoo\n" \
|
2016-09-18 20:48:13 +00:00
|
|
|
pkgconf --static --libs static-libs
|
|
|
|
}
|
|
|
|
|
|
|
|
missing_body()
|
|
|
|
{
|
|
|
|
export PKG_CONFIG_PATH="${selfdir}/lib1"
|
|
|
|
atf_check \
|
|
|
|
-s exit:1 \
|
|
|
|
-e ignore \
|
2022-08-08 09:26:22 +00:00
|
|
|
-o ignore \
|
2016-09-18 20:48:13 +00:00
|
|
|
pkgconf --cflags missing-require
|
|
|
|
}
|
2018-03-18 20:46:53 +00:00
|
|
|
|
|
|
|
requires_internal_body()
|
|
|
|
{
|
|
|
|
atf_check \
|
2023-01-21 20:22:03 +00:00
|
|
|
-o inline:"-lbar -lbar-private -L/test/lib -lfoo\n" \
|
2018-03-18 20:46:53 +00:00
|
|
|
pkgconf --with-path="${selfdir}/lib1" --static --libs requires-internal
|
|
|
|
}
|
|
|
|
|
|
|
|
requires_internal_missing_body()
|
|
|
|
{
|
|
|
|
atf_check \
|
|
|
|
-s exit:1 \
|
|
|
|
-e ignore \
|
|
|
|
-o ignore \
|
|
|
|
pkgconf --with-path="${selfdir}/lib1" --static --libs requires-internal-missing
|
|
|
|
}
|
2018-03-19 00:03:18 +00:00
|
|
|
|
|
|
|
requires_internal_collision_body()
|
|
|
|
{
|
|
|
|
atf_check \
|
2023-01-21 20:22:03 +00:00
|
|
|
-o inline:"-I/test/local/include/foo\n" \
|
2018-03-19 00:03:18 +00:00
|
|
|
pkgconf --with-path="${selfdir}/lib1" --cflags requires-internal-collision
|
|
|
|
}
|
2019-01-14 20:07:19 +00:00
|
|
|
|
|
|
|
orphaned_requires_private_body()
|
|
|
|
{
|
|
|
|
atf_check \
|
|
|
|
-s exit:1 \
|
|
|
|
-e ignore \
|
|
|
|
-o ignore \
|
|
|
|
pkgconf --with-path="${selfdir}/lib1" --cflags --libs orphaned-requires-private
|
|
|
|
}
|