mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-08 15:50:38 +00:00
tests: abuild: add test for invalid filename
This commit is contained in:
parent
a845a0bf1d
commit
1b66d65805
@ -6,7 +6,8 @@ init_tests \
|
|||||||
abuild_invalid_opt \
|
abuild_invalid_opt \
|
||||||
abuild_version \
|
abuild_version \
|
||||||
abuild_simple_pkg_without_deps \
|
abuild_simple_pkg_without_deps \
|
||||||
abuild_build_fail
|
abuild_build_fail \
|
||||||
|
abuild_invalid_filename
|
||||||
|
|
||||||
export ABUILD_SHAREDIR=$(atf_get_srcdir)/..
|
export ABUILD_SHAREDIR=$(atf_get_srcdir)/..
|
||||||
export ABUILD_CONF=/dev/null
|
export ABUILD_CONF=/dev/null
|
||||||
@ -48,7 +49,7 @@ abuild_simple_pkg_without_deps_body() {
|
|||||||
abuild_build_fail_body() {
|
abuild_build_fail_body() {
|
||||||
mkdir buildfail
|
mkdir buildfail
|
||||||
cat >buildfail/APKBUILD <<-EOF
|
cat >buildfail/APKBUILD <<-EOF
|
||||||
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
# Maintainer: Joe User <juser@example.com>
|
||||||
pkgname="buildfail"
|
pkgname="buildfail"
|
||||||
pkgver="1.0"
|
pkgver="1.0"
|
||||||
pkgrel=0
|
pkgrel=0
|
||||||
@ -72,5 +73,36 @@ abuild_build_fail_body() {
|
|||||||
atf_check -s exit:1 \
|
atf_check -s exit:1 \
|
||||||
-e match:"ERROR: buildfail: build failed" \
|
-e match:"ERROR: buildfail: build failed" \
|
||||||
abuild
|
abuild
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abuild_invalid_filename_body() {
|
||||||
|
mkdir invalid-filename
|
||||||
|
cd invalid-filename
|
||||||
|
cat >APKBUILD <<-EOF
|
||||||
|
# Maintainer: Joe User <juser@example.com>
|
||||||
|
pkgname="invalid-filename"
|
||||||
|
pkgver="1.0"
|
||||||
|
pkgrel=0
|
||||||
|
pkgdesc="Dummy test package that fails to build"
|
||||||
|
url="https://gitlab.alpinelinux.org/alpine/aports"
|
||||||
|
arch="noarch"
|
||||||
|
license="MIT"
|
||||||
|
prepare() {
|
||||||
|
mkdir -p "\$builddir"
|
||||||
|
}
|
||||||
|
build() {
|
||||||
|
touch $'bad\nfile'
|
||||||
|
}
|
||||||
|
check() {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
package() {
|
||||||
|
mkdir -p "\$pkgdir"
|
||||||
|
cp -r * "\$pkgdir"/
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
atf_check -s exit:1 \
|
||||||
|
-e match:"ERROR:.*: Found filenames with newline" \
|
||||||
|
abuild
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user