commit:     ff3c1baa23b2f4513e297407b3bce19682ffe830
Author:     Henning Schild <henning <AT> hennsch <DOT> de>
AuthorDate: Wed Aug  4 18:45:09 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sun Aug 15 14:46:03 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ff3c1baa

dev-util/bats: respect "makeopts_jobs" in test suite

The fact that the testsuite might run a random number of jobs if
"sys-process/parallel" is installed was raised in a bug. While this
commit does not solve the bug in question, it makes the test respect
MAKEOPTS"-jX".

Bug: https://bugs.gentoo.org/734358
Signed-off-by: Henning Schild <henning <AT> hennsch.de>
Closes: https://github.com/gentoo/gentoo/pull/21883
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-util/bats/bats-1.4.1.ebuild | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dev-util/bats/bats-1.4.1.ebuild b/dev-util/bats/bats-1.4.1.ebuild
index fba39b43420..b86c348b080 100644
--- a/dev-util/bats/bats-1.4.1.ebuild
+++ b/dev-util/bats/bats-1.4.1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit optfeature
+inherit multiprocessing optfeature
 
 MY_PN="bats-core"
 DESCRIPTION="Bats-core: Bash Automated Testing System"
@@ -20,7 +20,11 @@ RDEPEND="${DEPEND}"
 S="${WORKDIR}/${MY_PN}-${PV}"
 
 src_test() {
-       bin/bats --tap test || die "Tests failed"
+       local my_jobs=$(makeopts_jobs)
+       if ! command -v parallel; then
+               my_jobs=1
+       fi
+       bin/bats --tap --jobs "$my_jobs" test || die "Tests failed"
 }
 
 src_install() {

Reply via email to