# Nightly CMake Build Multiple Tests at Once

**URL:** https://discourse.cmake.org/t/nightly-cmake-build-multiple-tests-at-once/1298
**Category:** Development
**Created:** [May 31, 2020, 2:54pm UTC](https://discourse.cmake.org/t/nightly-cmake-build-multiple-tests-at-once/1298 "2020-05-31T14:54:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mknobloch](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mknobloch](https://discourse.cmake.org/u/mknobloch)
#### Post date: [May 31, 2020, 2:54pm UTC](https://discourse.cmake.org/t/nightly-cmake-build-multiple-tests-at-once/1298/1 "2020-05-31T14:54:46Z")

</div>

Hello all,

I am trying to run the CMake nightly build using the scripts provided from the CMake website, [https://gitlab.kitware.com/cmake/cmake/blob/master/Help/dev/testing.rst](https://gitlab.kitware.com/cmake/cmake/blob/master/Help/dev/testing.rst). After reading over cmake\_common.cmake it seems like to me that if I add `set(CTEST_BUILD_FLAGS "-j6")` then when it is running the tests it should run 6 tests at the same time. When I add this line to my my\_dashboard.cmake file it causes my build to fail to compile but if I remove the line then a full nightly build will succeed and post to the CMake CDash board. I am not sure what I am doing wrong and why adding this line causes the build to fail to compile.

Any suggestions would be appreciated.

Matt

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [June 1, 2020, 10:31am UTC](https://discourse.cmake.org/t/nightly-cmake-build-multiple-tests-at-once/1298/2 "2020-06-01T10:31:52Z")

</div>

`CTEST_BUILD_FLAGS` is for flags to the `make `tool during the build step. To run tests in parallel, see the `PARALLEL_LEVEL` option to the [ctest\_test](https://cmake.org/cmake/help/v3.17/command/ctest_test.html) command. In the `cmake_common.cmake` script, there are comments at the top about variables that can be set to control such arguments. See the `CTEST_TEST_ARGS` argument. It happens to document `PARALLEL_LEVEL` as an example. So:

```cmake
set(CTEST_TEST_ARGS PARALLEL_LEVEL 6)

```

---

<div class="post-metadata">

### Author: ![mknobloch](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mknobloch](https://discourse.cmake.org/u/mknobloch)
#### Post date: [June 9, 2020, 9:35pm UTC](https://discourse.cmake.org/t/nightly-cmake-build-multiple-tests-at-once/1298/3 "2020-06-09T21:35:37Z")

</div>

That helped thank you very much.
