Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC]: xbps-src: add make_check_pre
@ 2022-02-28 13:51 paper42
  2022-02-28 14:25 ` [PR PATCH] [Updated] " paper42
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: paper42 @ 2022-02-28 13:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

There is a new pull request by paper42 against master on the void-packages repository

https://github.com/paper42/void-packages make_check_pre
https://github.com/void-linux/void-packages/pull/35888

[RFC]: 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.

A patch file from https://github.com/void-linux/void-packages/pull/35888.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-make_check_pre-35888.patch --]
[-- Type: text/x-diff, Size: 8324 bytes --]

From b5f7d8cbf2b9112dfc67bdded08ab4ecf160378e Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Mon, 28 Feb 2022 14:40:07 +0100
Subject: [PATCH 1/2] 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.
---
 common/build-style/cargo.sh            | 2 +-
 common/build-style/cmake.sh            | 2 +-
 common/build-style/configure.sh        | 2 +-
 common/build-style/gnu-configure.sh    | 2 +-
 common/build-style/gnu-makefile.sh     | 2 +-
 common/build-style/meson.sh            | 2 +-
 common/build-style/perl-ModuleBuild.sh | 2 +-
 common/build-style/perl-module.sh      | 2 +-
 common/build-style/python-module.sh    | 2 +-
 common/build-style/python3-module.sh   | 4 ++--
 common/build-style/python3-pep517.sh   | 2 +-
 common/build-style/raku-dist.sh        | 2 +-
 common/environment/setup/sourcepkg.sh  | 2 +-
 13 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/common/build-style/cargo.sh b/common/build-style/cargo.sh
index 53c489772e7f..573a69003614 100644
--- a/common/build-style/cargo.sh
+++ b/common/build-style/cargo.sh
@@ -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}
 }
 
diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 33a556be0011..7d1d675c3aba 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -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() {
diff --git a/common/build-style/configure.sh b/common/build-style/configure.sh
index 0963fc347934..6f2c94ace694 100644
--- a/common/build-style/configure.sh
+++ b/common/build-style/configure.sh
@@ -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() {
diff --git a/common/build-style/gnu-configure.sh b/common/build-style/gnu-configure.sh
index 8121136cd121..f66b081955e2 100644
--- a/common/build-style/gnu-configure.sh
+++ b/common/build-style/gnu-configure.sh
@@ -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() {
diff --git a/common/build-style/gnu-makefile.sh b/common/build-style/gnu-makefile.sh
index d7ea148fc483..2492749bd84a 100644
--- a/common/build-style/gnu-makefile.sh
+++ b/common/build-style/gnu-makefile.sh
@@ -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() {
diff --git a/common/build-style/meson.sh b/common/build-style/meson.sh
index ab9f2cacfd0a..a7bd901e9760 100644
--- a/common/build-style/meson.sh
+++ b/common/build-style/meson.sh
@@ -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() {
diff --git a/common/build-style/perl-ModuleBuild.sh b/common/build-style/perl-ModuleBuild.sh
index a84373b5b0bf..f21d2b0efb4c 100644
--- a/common/build-style/perl-ModuleBuild.sh
+++ b/common/build-style/perl-ModuleBuild.sh
@@ -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() {
diff --git a/common/build-style/perl-module.sh b/common/build-style/perl-module.sh
index b9a01b13cfa9..9126091cb2cf 100644
--- a/common/build-style/perl-module.sh
+++ b/common/build-style/perl-module.sh
@@ -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() {
diff --git a/common/build-style/python-module.sh b/common/build-style/python-module.sh
index 15cf7577adb2..b80801a67247 100644
--- a/common/build-style/python-module.sh
+++ b/common/build-style/python-module.sh
@@ -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
 }
diff --git a/common/build-style/python3-module.sh b/common/build-style/python3-module.sh
index 093bdae8a006..8daf40e69219 100644
--- a/common/build-style/python3-module.sh
+++ b/common/build-style/python3-module.sh
@@ -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
 }
 
diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index 075f954a1a69..a733a521fb3d 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -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
diff --git a/common/build-style/raku-dist.sh b/common/build-style/raku-dist.sh
index 3b1f28d6421b..bbbba96e7140 100644
--- a/common/build-style/raku-dist.sh
+++ b/common/build-style/raku-dist.sh
@@ -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() {
diff --git a/common/environment/setup/sourcepkg.sh b/common/environment/setup/sourcepkg.sh
index bc06f745b78a..e0e16d7915cb 100644
--- a/common/environment/setup/sourcepkg.sh
+++ b/common/environment/setup/sourcepkg.sh
@@ -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

From e05cfec06a152a5c648f5d1267967fbafd8f5de1 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Mon, 28 Feb 2022 14:41:46 +0100
Subject: [PATCH 2/2] totem: fix tests

---
 srcpkgs/totem/template | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/srcpkgs/totem/template b/srcpkgs/totem/template
index c3e8c0911ba3..69483d536056 100644
--- a/srcpkgs/totem/template
+++ b/srcpkgs/totem/template
@@ -18,15 +18,12 @@ license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://wiki.gnome.org/Apps/Videos"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
 checksum=fce562e2b26cbcfc0c678538dcc81f9dc15ce60d5a89ee4358907bf634304c40
+make_check_pre="xvfb-run"
 
 # XXX xulrunner plugin.
 # XXX reenable python plugin if pylint pkg exists.
 #pycompile_dirs="usr/lib/totem/plugins"
 
-do_check() {
-	:
-}
-
 libtotem_package() {
 	short_desc+=" - runtime library"
 	pkg_install() {

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-08  1:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 13:51 [PR PATCH] [RFC]: xbps-src: add make_check_pre paper42
2022-02-28 14:25 ` [PR PATCH] [Updated] " paper42
2022-02-28 14:29 ` tibequadorian
2022-03-27 22:01 ` paper42
2022-04-06 17:42 ` paper42
2022-04-13 12:59 ` tibequadorian
2022-05-01 20:01 ` [PR PATCH] [Updated] " paper42
2022-05-04  8:46 ` [PR PATCH] [Merged]: " paper42
2022-05-08  1:16 ` sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).