summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-03-06 16:16:33 (GMT)
committerBrad King <brad.king@kitware.com>2024-03-10 15:41:39 (GMT)
commit5de1e21659090ca83e39e223d351e353347eb88e (patch)
tree1f618443c6abf98712619a5cb33a35c64439ab74 /Source/cmCTest.h
parentbbcbcff7d94bb3dd4b47ed5484207dc960911f4c (diff)
downloadCMake-5de1e21659090ca83e39e223d351e353347eb88e.zip
CMake-5de1e21659090ca83e39e223d351e353347eb88e.tar.gz
CMake-5de1e21659090ca83e39e223d351e353347eb88e.tar.bz2
ctest: Allow passing -j without value to choose a contextual default
Under job server integration, added by commit 80fe56c481 (ctest: Add support for running under a make job server on POSIX systems, 2023-11-15, v3.29.0-rc1~324^2), use a very high default so that parallelism is effectively limited only by available job server tokens. Otherwise, choose a default limit based on the number of processors. Also allow passing `0` to specify unbounded parallelism. Fixes: #25739
Diffstat (limited to 'Source/cmCTest.h')
-rw-r--r--Source/cmCTest.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 1644d84..2ab810c 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -12,6 +12,7 @@
#include <string>
#include <vector>
+#include <cm/optional>
#include <cm/string_view>
#include "cmDuration.h"
@@ -116,8 +117,8 @@ public:
cmDuration GetGlobalTimeout() const;
/** how many test to run at the same time */
- int GetParallelLevel() const;
- void SetParallelLevel(int);
+ cm::optional<size_t> GetParallelLevel() const;
+ void SetParallelLevel(cm::optional<size_t> level);
unsigned long GetTestLoad() const;
void SetTestLoad(unsigned long);