# \[4.0.0 rc2\] - "There was an error running ctest to determine available test executables"

**URL:** https://discourse.cmake.org/t/4-0-0-rc2-there-was-an-error-running-ctest-to-determine-available-test-executables/13687
**Category:** Development
**Created:** [March 5, 2025, 6:41pm UTC](https://discourse.cmake.org/t/4-0-0-rc2-there-was-an-error-running-ctest-to-determine-available-test-executables/13687 "2025-03-05T18:41:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![buildSystemPerson](https://discourse.cmake.org/user_avatar/discourse.cmake.org/buildsystemperson/32/2851_2.png) [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)
#### Post date: [March 5, 2025, 6:41pm UTC](https://discourse.cmake.org/t/4-0-0-rc2-there-was-an-error-running-ctest-to-determine-available-test-executables/13687/1 "2025-03-05T18:41:49Z")

</div>

### Brief Issue Summary

Currently getting this error when running tests via the `microsoft/vscode-cmake-tools` extension tool:

```auto
[proc] The command: /../ctest --show-only=json-v1 -j14 -C Debug -T test --output-on-failure exited with code: 8
[ctest] There was an error running ctest to determine available test executables

```

When I run it manually I get the following:

```auto
ctest --show-only=json-v1 -j14 -C Debug -T test --output-on-failure --test-dir build
CMake Error in .:
  ctest_test Failed to change working directory to "": No such file or
  directory

```

So this isn’t an issue with the extension.

Running `ctest -C Debug --output-on-failure --test-dir build` works fine. So it’s one of the above CLI options causing an issue with the working directory (I think).

I believe I’ve triaged it down to `-T test`. Adding that to my ctest command causes the error.

```auto
$ ctest -j14 -C Debug --output-on-failure --test-dir build
Test project /home/juaramos/projects/glslang/build
    Start 1: glslang-testsuite
    Start 2: glslang-gtests
1/2 Test #2: glslang-gtests ................... Passed 15.46 sec
2/2 Test #1: glslang-testsuite ................ Passed 28.28 sec

100% tests passed, 0 tests failed out of 2

Total Test time (real) = 28.28 sec
$ ctest -j14 -C Debug --output-on-failure --test-dir build -T test
Cannot find file: /home/juaramos/projects/glslang/build/DartConfiguration.tcl
Cannot find file: /home/juaramos/projects/glslang/build/DartConfiguration.tcl
CTEST_BINARY_DIRECTORY not set
CMake Error in .:
  ctest_test Failed to change working directory to "": No such file or
  directory

$ ctest --show-only=json-v1 -j14 -C Debug --output-on-failure --test-dir build -T test
CMake Error in .:
  ctest_test Failed to change working directory to "": No such file or
  directory

```

### Additional Information

I was using CMake version 3.22.1 which worked fine.

---

<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: [March 5, 2025, 8:12pm UTC](https://discourse.cmake.org/t/4-0-0-rc2-there-was-an-error-running-ctest-to-determine-available-test-executables/13687/2 "2025-03-05T20:12:50Z")

</div>

Thanks for trying the release candidate!

I reproduced that with `glslang` and narrowed it to a simple test case.

I’ve opened [CMake Issue 26743](https://gitlab.kitware.com/cmake/cmake/-/issues/26743) for this.

---

<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: [March 5, 2025, 9:44pm UTC](https://discourse.cmake.org/t/4-0-0-rc2-there-was-an-error-running-ctest-to-determine-available-test-executables/13687/3 "2025-03-05T21:44:24Z")

</div>

@buildSystemPerson what is the use case for passing `-T test` to `ctest` for `glslang`? The [`ctest -T <action>`](https://cmake.org/cmake/help/v4.0/manual/ctest.1.html#cmdoption-ctest-T) option is part of the [Dashboard Client Mode](https://cmake.org/cmake/help/v4.0/manual/ctest.1.html#dashboard-client), which is normally used in combination with `include(CTest)` in the project, which would populate `DartConfiguration.tcl` and avoid this error. If that is not the intention, one should avoid passing `-T test` in the first place.

---

<div class="post-metadata">

### Author: ![buildSystemPerson](https://discourse.cmake.org/user_avatar/discourse.cmake.org/buildsystemperson/32/2851_2.png) [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)
#### Post date: [March 5, 2025, 9:47pm UTC](https://discourse.cmake.org/t/4-0-0-rc2-there-was-an-error-running-ctest-to-determine-available-test-executables/13687/4 "2025-03-05T21:47:00Z")

</div>

I’m not sure what the use case is. But the vscode cmake tools extension is using it:

> <https://github.com/microsoft/vscode-cmake-tools/issues/4327>
>
> \### Brief Issue Summary
> 
> Currently getting an error like this when trying to run… tests via the extension tool:
> \`\`\`
> \[proc\] The command: /home/jpr42/dk/cmake-4.0.0-rc2-linux-x86\_64/bin/ctest --show-only=json-v1 -j14 -C Debug -T test --output-on-failure exited with code: 8
> \[ctest\] There was an error running ctest to determine available test executables
> \`\`\`
> 
> When I run it manually I get the following:
> \`\`\`
> ctest --show-only=json-v1 -j14 -C Debug -T test --output-on-failure --test-dir build
> CMake Error in .:
> ctest\_test Failed to change working directory to "": No such file or
> directory
> \`\`\`
> 
> However running \`ctest -C Debug --output-on-failure\` works fine.
> 
> I'm almost positive the cause is \`-T test\` when I add that to my command it fails in the command line for me. But I haven't deep dived into this.
> 
> I'm on Linux Ubuntu-22.04
> 
> \### Additional Information
> 
> I was using CMake version 3.22.1 which worked fine.

I’m not exactly sure what for though.

---

<div class="post-metadata">

### Author: ![buildSystemPerson](https://discourse.cmake.org/user_avatar/discourse.cmake.org/buildsystemperson/32/2851_2.png) [@buildSystemPerson](https://discourse.cmake.org/u/buildSystemPerson)
#### Post date: [March 6, 2025, 6:40pm UTC](https://discourse.cmake.org/t/4-0-0-rc2-there-was-an-error-running-ctest-to-determine-available-test-executables/13687/5 "2025-03-06T18:40:52Z")

</div>

I’ve made a PR removing this from the vscode cmake extension:

> <https://github.com/microsoft/vscode-cmake-tools/pull/4330>
>
> The ctest -T \<action\> option is part of the Dashboard Client Mode, and is not ne…cessary for simply running tests locally.
> 
> closes #4327

This also fixes a long standing error message for many users who don’t include the ctest CMake module.  
`Cannot find file: D:/Projects/cpp/bound/build/DartConfiguration.tcl.`
