summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2016-12-13 09:29:13 +0100
committerMichał Górny <mgorny@gentoo.org>2017-01-07 11:23:58 +0100
commitadfccec02c2474a509fc10d580a25d72f33cab55 (patch)
tree547583ae3bf441324d5c5e09e96214eb1699354d /eclass/cmake-utils.eclass
parentsci-libs/fftw: Fix parallel test failure (diff)
downloadgentoo-adfccec02c2474a509fc10d580a25d72f33cab55.tar.gz
gentoo-adfccec02c2474a509fc10d580a25d72f33cab55.tar.bz2
gentoo-adfccec02c2474a509fc10d580a25d72f33cab55.zip
cmake-utils.eclass: Support running ctest in parallel
Pass -j and --test-load options (with values based on MAKEOPTS) to CTest by default, in order to enable parallel test runs.
Diffstat (limited to 'eclass/cmake-utils.eclass')
-rw-r--r--eclass/cmake-utils.eclass7
1 files changed, 4 insertions, 3 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
index 1b269dd6d134..099aaac7b26f 100644
--- a/eclass/cmake-utils.eclass
+++ b/eclass/cmake-utils.eclass
@@ -117,7 +117,7 @@ case ${EAPI} in
*) die "EAPI=${EAPI:-0} is not supported" ;;
esac
-inherit toolchain-funcs multilib flag-o-matic eutils versionator
+inherit toolchain-funcs multilib flag-o-matic eutils multiprocessing versionator
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
@@ -780,8 +780,9 @@ enable_cmake-utils_src_test() {
[[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure )
- echo ctest "${myctestargs[@]}" "$@"
- if ctest "${myctestargs[@]}" "$@" ; then
+ set -- ctest -j "$(makeopts_jobs)" --test-load "$(makeopts_loadavg)" "${myctestargs[@]}" "$@"
+ echo "$@" >&2
+ if "$@" ; then
einfo "Tests succeeded."
popd > /dev/null || die
return 0