summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-06-20 22:05:02 +0200
committerMichał Górny <mgorny@gentoo.org>2020-06-23 20:30:38 +0200
commit691d57c4145649d211d6f8294377ea17a64ff18a (patch)
treecca78100c42a6b27cba7c090742e7f00dec3c1a5 /eclass
parentllvm.org.eclass: Declare CMAKE_BUILD_TYPE (diff)
downloadgentoo-691d57c4145649d211d6f8294377ea17a64ff18a.tar.gz
gentoo-691d57c4145649d211d6f8294377ea17a64ff18a.tar.bz2
gentoo-691d57c4145649d211d6f8294377ea17a64ff18a.zip
llvm.org.eclass: Add a helper function for common lit args
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/llvm.org.eclass20
1 files changed, 20 insertions, 0 deletions
diff --git a/eclass/llvm.org.eclass b/eclass/llvm.org.eclass
index 29606a63b5a0..36c4f52650fd 100644
--- a/eclass/llvm.org.eclass
+++ b/eclass/llvm.org.eclass
@@ -63,6 +63,8 @@ fi
[[ ${PV} == ${_LLVM_MASTER_MAJOR}.* && ${_LLVM_SOURCE_TYPE} == tar ]] &&
die "${ECLASS}: Release ebuild for master branch?!"
+inherit multiprocessing
+
# == control variables ==
@@ -245,3 +247,21 @@ llvm.org_src_prepare() {
popd >/dev/null || die
fi
}
+
+
+# == helper functions ==
+
+# @ECLASS-VARIABLE: LIT_JOBS
+# @USER_VARIABLE
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Number of test jobs to run simultaneously. If unset, defaults
+# to '-j' in MAKEOPTS. If that is not found, default to nproc.
+
+# @FUNCTION: get_lit_flags
+# @DESCRIPTION:
+# Get the standard recommended lit flags for running tests, in CMake
+# list form (;-separated).
+get_lit_flags() {
+ echo "-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}"
+}