xbps-src: add make_check_pre

$make_check_pre can be used for wrapper commands like xvfb-run or
dbus-run-session which are common ways to make tests work. This way many
templates can avoid defining their own do_check function.
This commit is contained in:
Michal Vasilek 2022-02-28 14:40:07 +01:00 committed by Echo
parent f991e72bf1
commit 71b11fdbdb
14 changed files with 17 additions and 14 deletions

View File

@ -600,6 +600,9 @@ path of the Python wheel produced by the build phase that will be installed; whe
`python-pep517` build style will look for a wheel matching the package name and version in the
current directory with respect to the install.
- `make_check_pre` The expression in front of `${make_cmd}`. This can be used for wrapper commands
or for setting environment variables for the check command. By default empty.
- `patch_args` The arguments to be passed in to the `patch(1)` command when applying
patches to the package sources during `do_patch()`. Patches are stored in
`srcpkgs/<pkgname>/patches` and must be in `-p1` format. By default set to `-Np1`.

View File

@ -11,7 +11,7 @@ do_build() {
do_check() {
: ${make_cmd:=cargo}
${make_cmd} test --release --target ${RUST_TARGET} ${configure_args} \
${make_check_pre} ${make_cmd} test --release --target ${RUST_TARGET} ${configure_args} \
${make_check_args}
}

View File

@ -116,7 +116,7 @@ do_check() {
: ${make_check_target:=test}
${make_cmd} ${make_check_args} ${make_check_target}
${make_check_pre} ${make_cmd} ${make_check_args} ${make_check_target}
}
do_install() {

View File

@ -29,7 +29,7 @@ do_check() {
: ${make_cmd:=make}
: ${make_check_target:=check}
${make_cmd} ${make_check_args} ${make_check_target}
${make_check_pre} ${make_cmd} ${make_check_args} ${make_check_target}
}
do_install() {

View File

@ -30,7 +30,7 @@ do_check() {
: ${make_cmd:=make}
: ${make_check_target:=check}
${make_cmd} ${make_check_args} ${make_check_target}
${make_check_pre} ${make_cmd} ${make_check_args} ${make_check_target}
}
do_install() {

View File

@ -30,7 +30,7 @@ do_check() {
: ${make_cmd:=make}
: ${make_check_target:=check}
${make_cmd} ${make_check_args} ${make_check_target}
${make_check_pre} ${make_cmd} ${make_check_args} ${make_check_target}
}
do_install() {

View File

@ -138,7 +138,7 @@ do_check() {
: ${make_check_target:=test}
: ${meson_builddir:=build}
${make_cmd} -C ${meson_builddir} ${makejobs} ${make_check_args} ${make_check_target}
${make_check_pre} ${make_cmd} -C ${meson_builddir} ${makejobs} ${make_check_args} ${make_check_target}
}
do_install() {

View File

@ -41,7 +41,7 @@ do_check() {
if [ ! -x ./Build ]; then
msg_error "$pkgver: cannot find ./Build script!\n"
fi
./Build test
${make_check_pre} ./Build test
}
do_install() {

View File

@ -79,7 +79,7 @@ do_check() {
: ${make_cmd:=make}
: ${make_check_target:=test}
${make_cmd} ${make_check_args} ${make_check_target}
${make_check_pre} ${make_cmd} ${make_check_args} ${make_check_target}
}
do_install() {

View File

@ -49,7 +49,7 @@ do_check() {
fi
fi
python${pyver} setup.py ${make_check_target:-test} ${make_check_args}
${make_check_pre} python${pyver} setup.py ${make_check_target:-test} ${make_check_args}
rm build
done
}

View File

@ -25,7 +25,7 @@ do_build() {
do_check() {
if python3 -c 'import pytest' >/dev/null 2>&1; then
PYTHONPATH="$(cd build/lib* && pwd)" \
${make_check_pre} PYTHONPATH="$(cd build/lib* && pwd)" \
python3 -m pytest ${make_check_args} ${make_check_target}
else
# Fall back to deprecated setup.py test orchestration without pytest
@ -37,7 +37,7 @@ do_check() {
fi
: ${make_check_target:=test}
python3 setup.py ${make_check_target} ${make_check_args}
${make_check_pre} python3 setup.py ${make_check_target} ${make_check_args}
fi
}

View File

@ -14,7 +14,7 @@ do_build() {
do_check() {
if python3 -c 'import pytest' >/dev/null 2>&1; then
python3 -m pytest ${make_check_args} ${make_check_target}
${make_check_pre} python3 -m pytest ${make_check_args} ${make_check_target}
else
msg_warn "Unable to determine tests for PEP517 Python templates"
return 0

View File

@ -3,7 +3,7 @@
#
do_check() {
RAKULIB=lib prove -r -e raku t/
${make_check_pre} RAKULIB=lib prove -r -e raku t/
}
do_install() {

View File

@ -7,7 +7,7 @@ unset -v archs distfiles checksum build_style build_helper nocross broken
unset -v configure_script configure_args wrksrc build_wrksrc create_wrksrc
unset -v make_build_args make_check_args make_install_args
unset -v make_build_target make_check_target make_install_target
unset -v make_cmd meson_cmd gem_cmd fetch_cmd
unset -v make_cmd meson_cmd gem_cmd fetch_cmd make_check_pre
unset -v python_version stackage
unset -v cmake_builddir meson_builddir
unset -v meson_crossfile