[CMake] CTEST_COMMAND ignores -j in ctest command script

Marcus D. Hanwell marcus.hanwell at kitware.com
Sat Feb 27 14:44:21 EST 2010


On Sat, Feb 27, 2010 at 2:11 PM, Derek Bruening <iye at alum.mit.edu> wrote:

> I have a ctest command script that runs a series of builds and tests via
> ctest_start(), ctest_test(), etc.  I want to run the tests in parallel by
> default (I'm using cmake 2.8.0).  If I pass -j to the ctest command that
> invokes the script, the tests are run in parallel:
>
>  ctest -j5 -S /path/to/script.cmake
>
> However if I pass the -j via CTEST_COMMAND:
>
>  set(CTEST_COMMAND "${CTEST_EXECUTABLE_NAME} -j5")
>
> and do not pass it in when invoking the script, the tests are not run in
> parallel.  Why is that?  Is there some way to accomplish this?
>

I think you want to add the PARALLEL_LEVEL argument to the ctest_test
command,

ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 8)

This command would run up to eight tests in parallel.

Marcus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100227/bb742ef7/attachment.htm>


More information about the CMake mailing list