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

* Re: [PR PATCH] [Updated] [RFC]: xbps-src: add make_check_pre
  2022-02-28 13:51 [PR PATCH] [RFC]: xbps-src: add make_check_pre paper42
@ 2022-02-28 14:25 ` paper42
  2022-02-28 14:29 ` tibequadorian
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paper42 @ 2022-02-28 14:25 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 8741 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 934789f7881269fa3d79f6595c2782e0a6c91de4 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 | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/totem/template b/srcpkgs/totem/template
index c3e8c0911ba3..bccea7f2a7c3 100644
--- a/srcpkgs/totem/template
+++ b/srcpkgs/totem/template
@@ -12,21 +12,19 @@ makedepends="clutter-gst3-devel clutter-gtk-devel dbus-glib-devel
  gst-plugins-ugly1 libSM-devel libXtst-devel libepc-devel libpeas-devel
  nautilus-devel zeitgeist-devel gst-plugins-base1-devel"
 depends="grilo-plugins gst-libav gst-plugins-good1 gst-plugins-ugly1 tracker3"
+checkdepends="xvfb-run"
 short_desc="GNOME integrated movie player based on Gstreamer"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 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

* Re: [RFC]: xbps-src: add make_check_pre
  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
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tibequadorian @ 2022-02-28 14:29 UTC (permalink / raw)
  To: ml

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

New comment by tibequadorian on void-packages repository

https://github.com/void-linux/void-packages/pull/35888#issuecomment-1054314577

Comment:
What do you think of introducing `check_helper`/`check_wrapper` which automatically append necessary values to `make_check_pre` and `checkdepends`?

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

* Re: [RFC]: xbps-src: add make_check_pre
  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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paper42 @ 2022-03-27 22:01 UTC (permalink / raw)
  To: ml

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

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/35888#issuecomment-1080027667

Comment:
> What do you think of introducing `check_helper`/`check_wrapper` which automatically append necessary values to `make_check_pre` and `checkdepends`?

I think that would only save one line and confuse some people.

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

* Re: [RFC]: xbps-src: add make_check_pre
  2022-02-28 13:51 [PR PATCH] [RFC]: xbps-src: add make_check_pre paper42
                   ` (2 preceding siblings ...)
  2022-03-27 22:01 ` paper42
@ 2022-04-06 17:42 ` paper42
  2022-04-13 12:59 ` tibequadorian
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paper42 @ 2022-04-06 17:42 UTC (permalink / raw)
  To: ml

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

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/35888#issuecomment-1090548764

Comment:
> This is fine as is, but you could also consider `make_check_wrapper` or `make_check_runner` if you think those names make their purpose a little more obvious than `_pre`.

We can also set env. variables with make_check_pre, so I think make_check_pre is better, but if other people think make_check_wrap(per) would be better, I can switch it. 

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

* Re: [RFC]: xbps-src: add make_check_pre
  2022-02-28 13:51 [PR PATCH] [RFC]: xbps-src: add make_check_pre paper42
                   ` (3 preceding siblings ...)
  2022-04-06 17:42 ` paper42
@ 2022-04-13 12:59 ` tibequadorian
  2022-05-01 20:01 ` [PR PATCH] [Updated] " paper42
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: tibequadorian @ 2022-04-13 12:59 UTC (permalink / raw)
  To: ml

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

New comment by tibequadorian on void-packages repository

https://github.com/void-linux/void-packages/pull/35888#issuecomment-1098020714

Comment:
make_check_pre is fine :)

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

* Re: [PR PATCH] [Updated] [RFC]: xbps-src: add make_check_pre
  2022-02-28 13:51 [PR PATCH] [RFC]: xbps-src: add make_check_pre paper42
                   ` (4 preceding siblings ...)
  2022-04-13 12:59 ` tibequadorian
@ 2022-05-01 20:01 ` paper42
  2022-05-04  8:46 ` [PR PATCH] [Merged]: " paper42
  2022-05-08  1:16 ` sgn
  7 siblings, 0 replies; 9+ messages in thread
From: paper42 @ 2022-05-01 20:01 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 9569 bytes --]

From 993560a7c87fa933f7b7bed2966cb4fa89b18d54 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.
---
 Manual.md                              | 3 +++
 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 +-
 14 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/Manual.md b/Manual.md
index 8ec755499bbe..1ce07792f546 100644
--- a/Manual.md
+++ b/Manual.md
@@ -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`.
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 ac6ee18a0dbb8b4c207574a8afc0b808997d7518 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 | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/totem/template b/srcpkgs/totem/template
index c3e8c0911ba3..bccea7f2a7c3 100644
--- a/srcpkgs/totem/template
+++ b/srcpkgs/totem/template
@@ -12,21 +12,19 @@ makedepends="clutter-gst3-devel clutter-gtk-devel dbus-glib-devel
  gst-plugins-ugly1 libSM-devel libXtst-devel libepc-devel libpeas-devel
  nautilus-devel zeitgeist-devel gst-plugins-base1-devel"
 depends="grilo-plugins gst-libav gst-plugins-good1 gst-plugins-ugly1 tracker3"
+checkdepends="xvfb-run"
 short_desc="GNOME integrated movie player based on Gstreamer"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 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

* Re: [PR PATCH] [Merged]: [RFC]: xbps-src: add make_check_pre
  2022-02-28 13:51 [PR PATCH] [RFC]: xbps-src: add make_check_pre paper42
                   ` (5 preceding siblings ...)
  2022-05-01 20:01 ` [PR PATCH] [Updated] " paper42
@ 2022-05-04  8:46 ` paper42
  2022-05-08  1:16 ` sgn
  7 siblings, 0 replies; 9+ messages in thread
From: paper42 @ 2022-05-04  8:46 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

[RFC]: xbps-src: add make_check_pre
https://github.com/void-linux/void-packages/pull/35888

Description:
$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.

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

* Re: [RFC]: xbps-src: add make_check_pre
  2022-02-28 13:51 [PR PATCH] [RFC]: xbps-src: add make_check_pre paper42
                   ` (6 preceding siblings ...)
  2022-05-04  8:46 ` [PR PATCH] [Merged]: " paper42
@ 2022-05-08  1:16 ` sgn
  7 siblings, 0 replies; 9+ messages in thread
From: sgn @ 2022-05-08  1:16 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/35888#issuecomment-1120327830

Comment:
90c35c4ac1, (common/do_check: move make_check_pre behind env setting, 2022-05-08)

^ 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).