public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: matoro <matoro_mailinglist_gentoo-dev@matoro.tk>
To: Gentoo Dev <gentoo-dev@lists.gentoo.org>
Subject: [gentoo-dev] [PATCH] perl-module.eclass: extend DIST_TEST="do" to cover make-based tests
Date: Sat, 14 Oct 2023 19:00:03 -0400	[thread overview]
Message-ID: <f2939227603e4e2355097e54411e76de@matoro.tk> (raw)

For packages using make to run tests rather than Test::Harness,
DIST_TEST="do" is ineffective at disabling parallelization.  This forces
-j1 on these packages when set.

Bug: https://bugs.gentoo.org/909051
Signed-off-by: Matoro Mahri <matoro@users.noreply.github.com>
---
  eclass/perl-module.eclass | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
index 32cd603c7be5..7bb02abed8c5 100644
--- a/eclass/perl-module.eclass
+++ b/eclass/perl-module.eclass
@@ -335,6 +335,7 @@ perl-module_src_test() {

  	local my_test_control
  	local my_test_verbose
+	local my_test_makeopts

  	[[ -n "${DIST_TEST_OVERRIDE}" ]] && ewarn "DIST_TEST_OVERRIDE is set 
to ${DIST_TEST_OVERRIDE}"
  	my_test_control=${DIST_TEST_OVERRIDE:-${DIST_TEST:-do parallel}}
@@ -344,6 +345,10 @@ perl-module_src_test() {
  		return 0
  	fi

+	if has 'do' ${my_test_control} && ! has 'parallel' ${my_test_control} 
; then
+		my_test_makeopts="-j1"
+	fi
+
  	if has verbose ${my_test_control} ; then
  		my_test_verbose=1
  	else
@@ -383,7 +388,7 @@ perl-module_src_test() {
  	if [[ -f Build ]] ; then
  		./Build test verbose=${my_test_verbose} || die "test failed"
  	elif [[ -f Makefile ]] ; then
-		emake test TEST_VERBOSE=${my_test_verbose}
+		emake ${my_test_makeopts} test TEST_VERBOSE=${my_test_verbose}
  	fi
  }

-- 
2.42.0



                 reply	other threads:[~2023-10-14 23:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f2939227603e4e2355097e54411e76de@matoro.tk \
    --to=matoro_mailinglist_gentoo-dev@matoro.tk \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox