ctest: No way to run ctest in parallel and let a job server determine the upper limit
With the new job server support added in !9021 (merged), ctest now detects when it is running under a job server and will coordinate with that job server when it launches new tests. But running ctest in parallel requires that you specify an upper limit on the number of jobs, and in this case, it would be reasonable for the user to want to let that be determined by the job server instead.
There's currently no way to tell ctest to run in parallel without specifying an upper limit on the number of jobs. Perhaps we could allow the -j
or --parallel
option to be given without a value to support this use case? We could consider making that an error if ctest is not being run under a job server, or we could just put the onus on the user not to do something silly, which is the approach that tools like make
have taken when allowing -j
without a value. We already support the "no value" case with cmake --build
, so there's precedent for it.
We would also need to consider the CTEST_PARALLEL_LEVEL
environment variable. It should be handled consistently, either supporting 0 as a special value, or allowing it to be defined but empty.