[CMake] CTEST_COMMAND ignores -j in ctest command script

Derek Bruening iye at alum.mit.edu
Sat Feb 27 15:37:16 EST 2010


On Sat, Feb 27, 2010 at 02:44:21PM -0500, Marcus D. Hanwell wrote:
> 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

Thanks, that works.

- Derek


More information about the CMake mailing list