abuild: add test for -doc subpackages

This commit is contained in:
Natanael Copa 2022-12-01 15:46:03 +01:00
parent f8208aded0
commit b253118cca
1 changed files with 40 additions and 1 deletions

View File

@ -25,7 +25,8 @@ init_tests \
abuild_git_ceiling \
abuild_package_size_zero \
abuild_package_size_nonzero \
abuild_amove
abuild_amove \
abuild_doc
export ABUILD_SHAREDIR=$(atf_get_srcdir)/..
export ABUILD_CONF=/dev/null
@ -594,3 +595,41 @@ abuild_amove_body() {
test -f pkg/$i || atf_fail "$i failed"
done
}
abuild_doc_body() {
init_keys
mkdir -p foo
cd foo
cat > APKBUILD <<-EOF
# Maintainer: Test User 123 <123@example.com>
# test package
pkgname="foo"
pkgver="1.0"
pkgrel=0
pkgdesc='Dummy test package - doc'
url='https://gitlab.alpinelinux.org/alpine/aports'
arch='noarch'
license='MIT'
subpackages="\$pkgname-doc"
build() {
touch foo foo.1 readme
}
package() {
install -Dt "\$pkgdir"/usr/bin foo
install -Dt "\$pkgdir"/usr/share/man/man1 foo.1
install -Dt "\$pkgdir"/usr/share/doc/foo readme
}
EOF
abuild build rootpkg || atf_fail "abuild rootpkg failed"
find pkg
for i in \
foo/usr/bin/foo \
foo-doc/usr/share/man/man1/foo.1.gz \
foo-doc/usr/share/doc/foo/readme \
; do \
test -f pkg/$i || atf_fail "$i failed"
done
}