summaryrefslogtreecommitdiff
path: root/eclass/meson.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-06-02 21:45:28 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-06-02 21:45:28 +0100
commit2018227e9344edb9da15fc6a4a8298086cc2aa77 (patch)
treec18e1c09e605e94e2a1e93345ad25746cc9e14b9 /eclass/meson.eclass
parent6f8038813c460b4f0572d5ef595cdfa94af3a94d (diff)
gentoo resync : 02.06.2019
Diffstat (limited to 'eclass/meson.eclass')
-rw-r--r--eclass/meson.eclass25
1 files changed, 23 insertions, 2 deletions
diff --git a/eclass/meson.eclass b/eclass/meson.eclass
index 65b09932a7ac..b9562376b868 100644
--- a/eclass/meson.eclass
+++ b/eclass/meson.eclass
@@ -41,7 +41,7 @@ esac
if [[ -z ${_MESON_ECLASS} ]]; then
-inherit ninja-utils python-utils-r1 toolchain-funcs
+inherit multiprocessing ninja-utils python-utils-r1 toolchain-funcs
fi
@@ -78,6 +78,12 @@ fi
# Optional meson arguments as Bash array; this should be defined before
# calling meson_src_configure.
+# @VARIABLE: emesontestargs
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Optional meson test arguments as Bash array; this should be defined before
+# calling meson_src_test.
+
read -d '' __MESON_ARRAY_PARSER <<"EOF"
import shlex
@@ -246,12 +252,27 @@ meson_src_compile() {
}
# @FUNCTION: meson_src_test
+# @USAGE: [extra meson test arguments]
# @DESCRIPTION:
# This is the meson_src_test function.
meson_src_test() {
debug-print-function ${FUNCNAME} "$@"
- eninja -C "${BUILD_DIR}" test
+ local mesontestargs=(
+ --verbose
+ -C "${BUILD_DIR}"
+ )
+ [[ -n ${NINJAOPTS} || -n ${MAKEOPTS} ]] &&
+ mesontestargs+=(
+ --num-processes "$(makeopts_jobs ${NINJAOPTS:-${MAKEOPTS}})"
+ )
+
+ # Append additional arguments from ebuild
+ mesontestargs+=("${emesontestargs[@]}")
+
+ set -- meson test "${mesontestargs[@]}" "$@"
+ echo "$@" >&2
+ "$@" || die "tests failed"
}
# @FUNCTION: meson_src_install