public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/2] cmake.eclass: Permit overriding CTEST_{JOBS,LOADAVG}
@ 2024-12-11  6:13 Michał Górny
  2024-12-11  6:13 ` [gentoo-dev] [PATCH 2/2] cmake.eclass: Use get_makeopts_{jobs,loadavg} Michał Górny
  0 siblings, 1 reply; 2+ messages in thread
From: Michał Górny @ 2024-12-11  6:13 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Closes: https://bugs.gentoo.org/945081
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/cmake.eclass | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index 8079a5cb037b..9b05f29139a5 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -681,6 +681,19 @@ cmake-utils_src_make() {
 	die "cmake-utils_src_make is banned. Use cmake_build instead"
 }
 
+# @ECLASS_VARIABLE: CTEST_JOBS
+# @USER_VARIABLE
+# @DESCRIPTION:
+# Maximum number of CTest jobs to run in parallel.  If unset, the value
+# will be determined from make options.
+
+# @ECLASS_VARIABLE: CTEST_LOADAVG
+# @USER_VARIABLE
+# @DESCRIPTION:
+# Maximum load, over which no new jobs will be started by CTest.  Note
+# that unlike make, CTest will not start *any* jobs if the load
+# is exceeded.  If unset, the value will be determined from make options.
+
 # @FUNCTION: cmake_src_test
 # @DESCRIPTION:
 # Function for testing the package. Automatically detects the build type.
@@ -694,8 +707,9 @@ cmake_src_test() {
 	[[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure )
 	[[ -n ${CMAKE_SKIP_TESTS} ]] && myctestargs+=( -E '('$( IFS='|'; echo "${CMAKE_SKIP_TESTS[*]}")')'  )
 
-	set -- ctest -j "$(makeopts_jobs "${MAKEOPTS}" 999)" \
-		--test-load "$(makeopts_loadavg)" "${myctestargs[@]}" "$@"
+	set -- ctest -j "${CTEST_JOBS:-$(makeopts_jobs "${MAKEOPTS}" 999)}" \
+		--test-load "${CTEST_LOADAVG:-$(makeopts_loadavg)}" \
+		"${myctestargs[@]}" "$@"
 	echo "$@" >&2
 	if "$@" ; then
 		einfo "Tests succeeded."
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-dev] [PATCH 2/2] cmake.eclass: Use get_makeopts_{jobs,loadavg}
  2024-12-11  6:13 [gentoo-dev] [PATCH 1/2] cmake.eclass: Permit overriding CTEST_{JOBS,LOADAVG} Michał Górny
@ 2024-12-11  6:13 ` Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2024-12-11  6:13 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/cmake.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/cmake.eclass b/eclass/cmake.eclass
index 9b05f29139a5..1a591331c4c9 100644
--- a/eclass/cmake.eclass
+++ b/eclass/cmake.eclass
@@ -707,8 +707,8 @@ cmake_src_test() {
 	[[ -n ${TEST_VERBOSE} ]] && myctestargs+=( --extra-verbose --output-on-failure )
 	[[ -n ${CMAKE_SKIP_TESTS} ]] && myctestargs+=( -E '('$( IFS='|'; echo "${CMAKE_SKIP_TESTS[*]}")')'  )
 
-	set -- ctest -j "${CTEST_JOBS:-$(makeopts_jobs "${MAKEOPTS}" 999)}" \
-		--test-load "${CTEST_LOADAVG:-$(makeopts_loadavg)}" \
+	set -- ctest -j "${CTEST_JOBS:-$(get_makeopts_jobs 999)}" \
+		--test-load "${CTEST_LOADAVG:-$(get_makeopts_loadavg)}" \
 		"${myctestargs[@]}" "$@"
 	echo "$@" >&2
 	if "$@" ; then
-- 
2.47.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-11  6:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-11  6:13 [gentoo-dev] [PATCH 1/2] cmake.eclass: Permit overriding CTEST_{JOBS,LOADAVG} Michał Górny
2024-12-11  6:13 ` [gentoo-dev] [PATCH 2/2] cmake.eclass: Use get_makeopts_{jobs,loadavg} Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox