tests: move more regression tests out of kyua

Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
This commit is contained in:
Ariadne Conill 2025-12-30 13:06:52 -08:00
parent 222c5b5153
commit 20145bcfc1
13 changed files with 55 additions and 79 deletions

View File

@ -23,9 +23,13 @@ EXTRA_DIST = pkg.m4 \
libpkgconf/meson.build \
libpkgconf/config.h.meson \
libpkgconf/win-dirent.h \
t/basic/noargs.test \
t/basic/arbitrary-path.test \
t/basic/builtin-pkg-config-exists.test \
t/basic/builtin-pkg-config-pc_path-variable.test \
t/basic/builtin-pkgconf-exists.test \
t/basic/builtin-pkgconf-pc_path-variable.test \
t/basic/define-prefix.test \
t/basic/direct-query-with-pkg_config_path.test \
t/basic/env-tuple.test \
t/basic/exists-cflags-env.test \
t/basic/exists-cflags.test \
@ -36,6 +40,8 @@ EXTRA_DIST = pkg.m4 \
t/basic/exists-version-malformed.test \
t/basic/exists-version-minimum.test \
t/basic/exists-version-with-tilde.test \
t/basic/incomplete-cflags.test \
t/basic/incomplete-libs.test \
t/basic/libs.test \
t/basic/libs-cflags.test \
t/basic/libs-cflags-version.test \
@ -45,7 +51,10 @@ EXTRA_DIST = pkg.m4 \
t/basic/libs-cflags-version-not-provided.test \
t/basic/libs-env.test \
t/basic/malformed-empty-package.test \
t/basic/modversion-fullpath.test \
t/basic/modversion-noflatten.test \
t/basic/modversion-uninstalled.test \
t/basic/noargs.test \
t/basic/nocflags.test \
t/basic/nolibs.test \
t/basic/pkg-config-path.test \
@ -56,6 +65,7 @@ EXTRA_DIST = pkg.m4 \
t/basic/uninstalled.test \
t/basic/variable-env.test \
t/basic/variable-no-recursion.test \
t/basic/variable.test \
t/ordering/fragment-collision.test \
t/ordering/framework-1.test \
t/ordering/framework-2.test \
@ -69,6 +79,7 @@ EXTRA_DIST = pkg.m4 \
t/solver/libs-intermediary.test \
t/solver/libs-metapackage.test \
t/solver/libs-static-ordering.test \
t/solver/modversion-provides.test \
t/solver/provides-bar-any.test \
t/solver/provides-bar-versioned-equal.test \
t/solver/provides-bar-versioned-greater-than-equal.test \

View File

@ -0,0 +1,3 @@
Query: pkgconf
WantedFlags: exists
ExpectedExitCode: 0

View File

@ -0,0 +1,5 @@
PackageSearchPath: lib1
Query: pkg-config
WantVariable: pc_path
ExpectedExitCode: 0
ExpectedStdout: %TEST_FIXTURES_DIR%/lib1

View File

@ -0,0 +1,3 @@
Query: pkgconf
WantedFlags: exists
ExpectedExitCode: 0

View File

@ -0,0 +1,5 @@
PackageSearchPath: lib1
Query: pkgconf
WantVariable: pc_path
ExpectedExitCode: 0
ExpectedStdout: %TEST_FIXTURES_DIR%/lib1

View File

@ -0,0 +1,4 @@
Environment: PKG_CONFIG_PATH=%TEST_FIXTURES_DIR%/lib2
Query: %TEST_FIXTURES_DIR%/lib3/bar.pc
WantedFlags: cflags
ExpectedStdout: -fPIC -I/test/include/foo

View File

@ -0,0 +1,4 @@
PackageSearchPath: lib1
Query: incomplete
WantedFlags: cflags
ExpectedStdout:

View File

@ -0,0 +1,4 @@
PackageSearchPath: lib1
Query: incomplete
WantedFlags: libs
ExpectedStdout:

View File

@ -0,0 +1,3 @@
WantedFlags: modversion
Query: %TEST_FIXTURES_DIR%/lib1/bar.pc
ExpectedStdout: 1.3

View File

@ -0,0 +1,4 @@
PackageSearchPath: lib1
WantedFlags: modversion
Query: omg
ExpectedStdout: 1.2.3

4
t/basic/variable.test Normal file
View File

@ -0,0 +1,4 @@
PackageSearchPath: lib1
Query: foo
WantVariable: includedir
ExpectedStdout: /test/include

View File

@ -0,0 +1,4 @@
PackageSearchPath: lib1
WantedFlags: modversion
Query: unavailable
ExpectedStdout: 1.2.3

View File

@ -10,29 +10,20 @@ tests_init \
define_variable \
define_variable_override \
duplicate_tuple_upsert \
variable \
keep_system_libs \
libs \
libs_only \
libs_never_mergeback \
cflags_only \
cflags_never_mergeback \
incomplete_libs \
incomplete_cflags \
isystem_munge_sysroot \
idirafter_munge_sysroot \
modversion_common_prefix \
modversion_fullpath \
modversion_provides \
modversion_uninstalled \
modversion_one_word_expression \
modversion_two_word_expression \
modversion_three_word_expression \
modversion_one_word_expression_no_space \
modversion_one_word_expression_no_space_zero \
pcpath \
virtual_variable \
fragment_collision \
malformed_1 \
malformed_quoting \
explicit_sysroot \
@ -96,14 +87,6 @@ duplicate_tuple_upsert_body()
pkgconf --variable=prefix --with-path=${selfdir}/lib1 duplicate-tuple
}
variable_body()
{
export PKG_CONFIG_PATH="${selfdir}/lib1"
atf_check \
-o inline:"/test/include\n" \
pkgconf --variable=includedir foo
}
keep_system_libs_body()
{
export PKG_CONFIG_PATH="${selfdir}/lib1"
@ -160,22 +143,6 @@ cflags_never_mergeback_body()
pkgconf --cflags prefix-foo1 prefix-foo2
}
incomplete_libs_body()
{
export PKG_CONFIG_PATH="${selfdir}/lib1"
atf_check \
-o inline:"\n" \
pkgconf --libs incomplete
}
incomplete_cflags_body()
{
export PKG_CONFIG_PATH="${selfdir}/lib1"
atf_check \
-o inline:"\n" \
pkgconf --cflags incomplete
}
isystem_munge_sysroot_body()
{
export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR="${selfdir}"
@ -192,14 +159,6 @@ idirafter_munge_sysroot_body()
pkgconf --cflags idirafter
}
pcpath_body()
{
export PKG_CONFIG_PATH="${selfdir}/lib2"
atf_check \
-o inline:"-fPIC -I/test/include/foo\n" \
pkgconf --cflags ${selfdir}/lib3/bar.pc
}
sysroot_munge_body()
{
sed "s|/sysroot/|${selfdir}/|g" ${selfdir}/lib1/sysroot-dir.pc > ${selfdir}/lib1/sysroot-dir-selfdir.pc
@ -209,25 +168,6 @@ sysroot_munge_body()
pkgconf --libs sysroot-dir-selfdir
}
virtual_variable_body()
{
atf_check -s exit:0 \
pkgconf --exists pkg-config
atf_check -s exit:0 \
pkgconf --exists pkgconf
atf_check -o inline:"${pcpath}\n" \
pkgconf --variable=pc_path pkg-config
atf_check -o inline:"${pcpath}\n" \
pkgconf --variable=pc_path pkgconf
}
fragment_collision_body()
{
atf_check -o inline:"-D_BAZ -D_BAR -D_FOO -D_THREAD_SAFE -pthread\n" \
pkgconf --with-path="${selfdir}/lib1" --cflags fragment-collision
}
malformed_1_body()
{
atf_check -s exit:1 -o ignore \
@ -271,24 +211,6 @@ modversion_common_prefix_body()
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()
{
atf_check -o inline:"1.2.3\n" \
pkgconf --with-path="${selfdir}/lib1" --modversion omg
}
modversion_one_word_expression_body()
{
atf_check -o inline:"1.2.3\n" \