tests: add test for validating depends

This commit is contained in:
Natanael Copa 2024-10-08 12:28:30 +02:00
parent d5591e6ccf
commit ca9a11e492
2 changed files with 21 additions and 0 deletions

View File

@ -23,6 +23,7 @@ init_tests \
abuild_invalid_subpkgnames \
abuild_invalid_subpkg_version \
abuild_provide_pkgname \
abuild_validate_depends \
abuild_subpackage_arch \
abuild_large_doc_subpackage \
abuild_bigdocs \
@ -473,6 +474,24 @@ abuild_provide_pkgname_body() {
abuild validate
}
abuild_validate_depends_body() {
init_keys
cp -ra "$testrepo"/test-pkgname .
cd test-pkgname
TESTDEPENDS="foo" TESTMAKEDEPENDS="bar" \
atf_check -s exit:0 \
-e match:"Validating" \
abuild validate
TESTDEPENDS="foo=1.0 bar>=1.0" TESTMAKEDEPENDS="baz<=1.0 x<2.0 z>1 !blah" \
atf_check -s exit:0 \
-e match:"Validating" \
abuild validate
TESTDEPENDS="foo~1.0 bar>~1.0 baz<~1"
atf_check -s exit:0 \
-e match:"Validating" \
abuild validate
}
abuild_subpackage_arch_body() {
init_keys
cp -ra "$testrepo" .

View File

@ -8,6 +8,8 @@ arch="noarch"
license="MIT"
provides="${TESTPROVIDES-provided}"
subpackages="${TESTSUBNAME-$pkgname-sub}:_sub"
depends="$TESTDEPENDS"
makedepends="$TESTMAKEDEPENDS"
prepare() {
mkdir -p "$builddir"