From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 602FF138334 for ; Sun, 25 Aug 2019 17:37:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B7554E081A; Sun, 25 Aug 2019 17:37:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 63751E07DB for ; Sun, 25 Aug 2019 17:37:36 +0000 (UTC) Received: from naomi.gilbertsystems.net (d192-24-229-26.try.wideopenwest.com [24.192.26.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id 343A3349FC1 for ; Sun, 25 Aug 2019 17:37:35 +0000 (UTC) From: Mike Gilbert To: gentoo-dev@lists.gentoo.org Subject: [gentoo-dev] [PATCH] meson.eclass: refactor mesontestargs into its own function Date: Sun, 25 Aug 2019 13:37:32 -0400 Message-Id: <20190825173732.450816-1-floppym@gentoo.org> X-Mailer: git-send-email 2.23.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 33f86338-fe6e-4d67-86a2-5f9223b0aa93 X-Archives-Hash: 30ebb53eebb322267a8f8b979325c815 This will allow other src_test implementations to easily compute meson test arguments. Signed-off-by: Mike Gilbert --- eclass/meson.eclass | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/eclass/meson.eclass b/eclass/meson.eclass index fa859ace996f..b3deba0117fa 100644 --- a/eclass/meson.eclass +++ b/eclass/meson.eclass @@ -253,6 +253,19 @@ meson_src_compile() { eninja -C "${BUILD_DIR}" "$@" } +# @FUNCTION: meson_set_mesontestargs +# @DESCRIPTION: +# Set the mesontestargs array variable for use in meson_src_test or other +# src_test implementations. +meson_set_mesontestargs() { + mesontestargs=( -C "${BUILD_DIR}" ) + if [[ -n ${NINJAOPTS+set} || -n ${MAKEOPTS+set} ]]; then + mesontestargs+=( --num-processes "$(makeopts_jobs ${NINJAOPTS-${MAKEOPTS}})" ) + fi + # Append additional arguments from ebuild + mesontestargs+=("${emesontestargs[@]}") +} + # @FUNCTION: meson_src_test # @USAGE: [extra meson test arguments] # @DESCRIPTION: @@ -260,16 +273,8 @@ meson_src_compile() { meson_src_test() { debug-print-function ${FUNCNAME} "$@" - local mesontestargs=( - -C "${BUILD_DIR}" - ) - [[ -n ${NINJAOPTS} || -n ${MAKEOPTS} ]] && - mesontestargs+=( - --num-processes "$(makeopts_jobs ${NINJAOPTS:-${MAKEOPTS}})" - ) - - # Append additional arguments from ebuild - mesontestargs+=("${emesontestargs[@]}") + local -a mesontestargs + meson_set_mesontestargs set -- meson test "${mesontestargs[@]}" "$@" echo "$@" >&2 -- 2.23.0