Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use parallel jobs in ctest #664

Closed
boxerab opened this issue Nov 27, 2015 · 1 comment
Closed

Use parallel jobs in ctest #664

boxerab opened this issue Nov 27, 2015 · 1 comment

Comments

@boxerab
Copy link
Contributor

boxerab commented Nov 27, 2015

Running ctest with the option -j allows it to run tests in parallel. For example,

ctest -j 8

will run with 8 threads. On my quad core machine, this setting cut the time to run ctest in half.
As the test suite is growing ( a good thing), it is very helpful to shorten the test cycle.

So, it would be great to put this setting in the cmake files, somehow.

I tried setting

set(CTEST_PARALLEL_LEVEL 8)

in CTestCustom.cmake.in

but this didn't change the command line options.

@boxerab
Copy link
Contributor Author

boxerab commented Nov 28, 2015

CTEST_PARALLEL_LEVEL is an environment variable. On windows, it is not possible via cmake to add this command line option to the post-build step in visual studio. One solution is to set a windows environment variable named CTEST_PARALLEL_LEVEL, with value set to 8, for example. This will tell ctest to spawn 8 jobs when running the test suite.

@boxerab boxerab closed this as completed Nov 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant