tests: convert sbom-related tests

Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
This commit is contained in:
Ariadne Conill 2025-12-29 19:19:15 -08:00
parent 6867afe86e
commit a4ade8586d
9 changed files with 38 additions and 48 deletions

View File

@ -49,6 +49,12 @@ EXTRA_DIST = pkg.m4 \
t/basic/uninstalled.test \
t/solver/circular-reference-1.test \
t/solver/circular-reference-2.test \
t/sbom/license-file-bar.test \
t/sbom/license-file-foo.test \
t/sbom/license-isc.test \
t/sbom/license-noassertion.test \
t/sbom/source-tag-bar.test \
t/sbom/source-tag-foo.test \
tests/lib-relocatable/lib/pkgconfig/foo.pc \
tests/lib1/argv-parse-2.pc \
tests/lib1/billion-laughs.pc \
@ -281,6 +287,7 @@ CLEANFILES = $(EXTRA_PROGRAMS) \
check: pkgconf test-runner $(check_SCRIPTS)
$(builddir)/test-runner$(EXEEXT) --test-fixtures=$(top_srcdir)/tests $(top_srcdir)/t/basic
$(builddir)/test-runner$(EXEEXT) --test-fixtures=$(top_srcdir)/tests $(top_srcdir)/t/solver
$(builddir)/test-runner$(EXEEXT) --test-fixtures=$(top_srcdir)/tests $(top_srcdir)/t/sbom
kyua --config=none test --kyuafile='$(top_builddir)/Kyuafile' \
--build-root='$(top_builddir)'

View File

@ -176,6 +176,7 @@ fixtures_dir = '@0@/tests'.format(meson.current_source_dir())
test_suites = [
'basic',
'solver',
'sbom',
]
foreach t : test_suites

View File

@ -0,0 +1,6 @@
PackageSearchPath: lib1
WantedFlags: dump-license-file
Query: bar
ExpectedStdout: foo: https://foo.bar/foo/COPYING
ExpectedStdout: bar:
MatchStdout: partial

View File

@ -0,0 +1,4 @@
PackageSearchPath: lib1
WantedFlags: dump-license-file
Query: foo
ExpectedStdout: foo: https://foo.bar/foo/COPYING

4
t/sbom/license-isc.test Normal file
View File

@ -0,0 +1,4 @@
PackageSearchPath: lib1
WantedFlags: dump-license
Query: foo
ExpectedStdout: foo: ISC

View File

@ -0,0 +1,6 @@
PackageSearchPath: lib1
WantedFlags: dump-license
Query: bar
ExpectedStdout: bar: NOASSERTION
ExpectedStdout: foo: ISC
MatchStdout: partial

View File

@ -0,0 +1,6 @@
PackageSearchPath: lib1
WantedFlags: dump-source
Query: bar
ExpectedStdout: foo: https://foo.bar/foo
ExpectedStdout: bar:
MatchStdout: partial

View File

@ -0,0 +1,4 @@
PackageSearchPath: lib1
WantedFlags: dump-source
Query: foo
ExpectedStdout: foo: https://foo.bar/foo

View File

@ -8,17 +8,11 @@ tests_init \
libs_static \
libs_static_ordering \
libs_metapackage \
license_isc \
license_noassertion \
license_file_foo \
license_file_empty \
pkg_config_path \
arbitary_path \
with_path \
relocatable \
single_depth_selectors \
source_foo \
source_empty \
print_variables_env \
variable_env \
variable_no_recurse \
@ -108,48 +102,6 @@ single_depth_selectors_body()
pkgconf --with-path=${selfdir}/lib3 --print-requires bar
}
license_isc_body()
{
atf_check \
-o inline:"foo: ISC\n" \
pkgconf --with-path=${selfdir}/lib1 --license foo
}
license_noassertion_body()
{
atf_check \
-o inline:"bar: NOASSERTION\nfoo: ISC\n" \
pkgconf --with-path=${selfdir}/lib1 --license bar
}
license_file_foo_body()
{
atf_check \
-o inline:"foo: https://foo.bar/foo/COPYING\n" \
pkgconf --with-path=${selfdir}/lib1 --license-file foo
}
license_file_empty_body()
{
atf_check \
-o inline:"bar: \nfoo: https://foo.bar/foo/COPYING\n" \
pkgconf --with-path=${selfdir}/lib1 --license-file bar
}
source_foo_body()
{
atf_check \
-o inline:"foo: https://foo.bar/foo\n" \
pkgconf --with-path=${selfdir}/lib1 --source foo
}
source_empty_body()
{
atf_check \
-o inline:"bar: \nfoo: https://foo.bar/foo\n" \
pkgconf --with-path=${selfdir}/lib1 --source bar
}
print_variables_env_body()
{
atf_check \