# \#tool:ctest

**URL:** https://discourse.cmake.org/tag/tool-ctest/45.md

[Latest](https://discourse.cmake.org/latest.md) · [Categories](https://discourse.cmake.org/categories.md) · [Tags](https://discourse.cmake.org/tags.md)

---

## [JUnit Results for Collections of Tests](https://discourse.cmake.org/t/junit-results-for-collections-of-tests/15845)

<div class="topic-metadata">

**Author:** [@kevinyee](https://discourse.cmake.org/u/kevinyee)\
**Replies:** 0\
**Last updated:** [September 21, 2026, 3:53pm UTC](https://discourse.cmake.org/t/junit-results-for-collections-of-tests/15845 "2026-09-21T15:53:24Z")

</div>

My use case is for dotnet test, but I think this topic could apply to any collections of tests. I’m writing a MSTest library that I register with ctest with a COMMAND dotnet test like so: add\_library(MyTestLibrary SHAR…

---

## [Coverage report formats supported for CDash upload](https://discourse.cmake.org/t/coverage-report-formats-supported-for-cdash-upload/9950)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 6\
**Last updated:** [August 5, 2026, 4:35pm UTC](https://discourse.cmake.org/t/coverage-report-formats-supported-for-cdash-upload/9950 "2026-08-05T16:35:23Z")

</div>

Hello, I could not find documentation on the supported coverage report formats ( like cobertura xml, gcov, lcov etc) or the coverage tools, which can be used with ctest\_coverage to be uploaded to CDash. Where can I fin…

---

## [Valgrind "Mismatched new/delete size" not reported as a memory issue](https://discourse.cmake.org/t/valgrind-mismatched-new-delete-size-not-reported-as-a-memory-issue/15740)

<div class="topic-metadata">

**Author:** [@npoletz](https://discourse.cmake.org/u/npoletz)\
**Replies:** 1\
**Last updated:** [July 8, 2026, 4:01pm UTC](https://discourse.cmake.org/t/valgrind-mismatched-new-delete-size-not-reported-as-a-memory-issue/15740 "2026-07-08T16:01:29Z")

</div>

Hello, I recently encounter a Mismatched new/delete size value reported by valgrind but captured by cmake and thus not reported on our dashboard. The problem seems to be a missing regex in ProcessMemCheckValgrindOutpu…

---

## [Combine sanitizer check in one single MemCheck analysis](https://discourse.cmake.org/t/combine-sanitizer-check-in-one-single-memcheck-analysis/15658)

<div class="topic-metadata">

**Author:** [@npoletz](https://discourse.cmake.org/u/npoletz)\
**Replies:** 3\
**Last updated:** [July 8, 2026, 3:44pm UTC](https://discourse.cmake.org/t/combine-sanitizer-check-in-one-single-memcheck-analysis/15658 "2026-07-08T15:44:34Z")

</div>

I am currently testing the dynamic analysis with UndefinedBehaviorSanitizer and AddressSanitizer. It works well separately and defects are correctly reported on our dashboard. However I am wondering if there is a way t…

---

## [ctest\_build: Missing "obvious" error and warning matching regex?](https://discourse.cmake.org/t/ctest-build-missing-obvious-error-and-warning-matching-regex/15651)

<div class="topic-metadata">

**Author:** [@sjoubert](https://discourse.cmake.org/u/sjoubert)\
**Replies:** 0\
**Last updated:** [May 12, 2026, 2:01pm UTC](https://discourse.cmake.org/t/ctest-build-missing-obvious-error-and-warning-matching-regex/15651 "2026-05-12T14:01:20Z")

</div>

I just found that some warnings from a tool I run in a custom command did not get reported in my cdash build while I was seeing them in my local build. It turns out the warning lines start with warning: , but the built-…

---

## [Integrating CDash submission into a normal CI](https://discourse.cmake.org/t/integrating-cdash-submission-into-a-normal-ci/15587)

<div class="topic-metadata">

**Author:** [@fsimonis](https://discourse.cmake.org/u/fsimonis)\
**Replies:** 8\
**Last updated:** [April 8, 2026, 12:20pm UTC](https://discourse.cmake.org/t/integrating-cdash-submission-into-a-normal-ci/15587 "2026-04-08T12:20:20Z")

</div>

Hi, I’m having trouble integrating CDash into my project’s CI and haven’t found any good answers, so I’m asking here. I manage a pretty standard CI that configures, builds, and tests a CMake project for a range of confi…

---

## [Struggling to use VSCode with CMakePresets.json to invoke a test](https://discourse.cmake.org/t/struggling-to-use-vscode-with-cmakepresets-json-to-invoke-a-test/13667)

<div class="topic-metadata">

**Author:** [@exoosh](https://discourse.cmake.org/u/exoosh)\
**Replies:** 3\
**Last updated:** [October 8, 2025, 11:24pm UTC](https://discourse.cmake.org/t/struggling-to-use-vscode-with-cmakepresets-json-to-invoke-a-test/13667 "2025-10-08T23:24:15Z")

</div>

Hi, I would like to use the built-in facilities of VSCode to invoke ctest. However, I am unable to tell it to step into a given --test-dir via CMakePresets.json. And so I get one of two symptoms: if I call enable\_tes…

---

## [add\_test() assumes test executable is first string after COMMAND](https://discourse.cmake.org/t/add-test-assumes-test-executable-is-first-string-after-command/15012)

<div class="topic-metadata">

**Author:** [@chriskot870](https://discourse.cmake.org/u/chriskot870)\
**Replies:** 5\
**Last updated:** [August 16, 2025, 10:43pm UTC](https://discourse.cmake.org/t/add-test-assumes-test-executable-is-first-string-after-command/15012 "2025-08-16T22:43:47Z")

</div>

I am using cmake through vscode to cross-compile from a Ubuntu host to a Raspberry Pi Zero 2W target. I need to run the tests on the remote host. I created the following add\_test: add\_test( NAME UnitsPressureTests W…

---

## [ctest 10 minute timeout introduced between 3.31.0 and 4.1.0?](https://discourse.cmake.org/t/ctest-10-minute-timeout-introduced-between-3-31-0-and-4-1-0/14996)

<div class="topic-metadata">

**Author:** [@Markus87](https://discourse.cmake.org/u/Markus87)\
**Replies:** 6\
**Last updated:** [August 14, 2025, 1:33pm UTC](https://discourse.cmake.org/t/ctest-10-minute-timeout-introduced-between-3-31-0-and-4-1-0/14996 "2025-08-14T13:33:10Z")

</div>

ctest -T test -R SomeTest --debug 3.31.0: CTest\\cmCTestRunTest.cxx:836 247: Test timeout computed to be: 10000000 4.10.0: Test timeout computed to be: 600 I checked the offending source code and did some debugging, bu…

---

## [Find non-terminated tests with ctest -j](https://discourse.cmake.org/t/find-non-terminated-tests-with-ctest-j/9389)

<div class="topic-metadata">

**Author:** [@JanWielemaker](https://discourse.cmake.org/u/JanWielemaker)\
**Replies:** 13\
**Last updated:** [July 25, 2025, 1:02pm UTC](https://discourse.cmake.org/t/find-non-terminated-tests-with-ctest-j/9389 "2025-07-25T13:02:12Z")

</div>

Sometimes some test under ctest does not (or not timely) terminate. When running with -j and a high number of tasks it is very hard to figure out which test has not ended yet. On Linux we have a decent ps or pstree,…

---

## [ctest\_upload functionality](https://discourse.cmake.org/t/ctest-upload-functionality/10919)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 2\
**Last updated:** [March 14, 2025, 3:53pm UTC](https://discourse.cmake.org/t/ctest-upload-functionality/10919 "2025-03-14T15:53:10Z")

</div>

Hello, Could be a simple question this, where can i find the file uploaded using ctest\_upload() in the cdash dashboard? I can see that ctest\_upload() call returns successfully, but I cant seem to find the file in the da…

---

## [Adding gtest test to a CONFIGURATION](https://discourse.cmake.org/t/adding-gtest-test-to-a-configuration/10511)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 1\
**Last updated:** [March 4, 2025, 9:02am UTC](https://discourse.cmake.org/t/adding-gtest-test-to-a-configuration/10511 "2025-03-04T09:02:23Z")

</div>

Am I right, that you cannot add gtest testcase to a test configuration using gtest\_add\_tests()? It does not have any argument for CONFIGURATION and CONFIGURATION is not a test property I can manually add.

---

## [set\_tests\_properties ENVIRONMENT ignored](https://discourse.cmake.org/t/set-tests-properties-environment-ignored/13425)

<div class="topic-metadata">

**Author:** [@RobStewart](https://discourse.cmake.org/u/RobStewart)\
**Replies:** 1\
**Last updated:** [January 21, 2025, 12:53pm UTC](https://discourse.cmake.org/t/set-tests-properties-environment-ignored/13425 "2025-01-21T12:53:47Z")

</div>

In my CMakeLists.txt, I define a Python unit test like this: ADD\_TEST(NAME foo COMMAND "${python}" -B -m unittest discover -v WORKING\_DIRECTORY ${CMAKE\_CURRENT\_SOURCE\_DIR} ) For that to work, a related .pyd must …

---

## [Sarif viewer for cdash](https://discourse.cmake.org/t/sarif-viewer-for-cdash/13282)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 0\
**Last updated:** [December 29, 2024, 9:14am UTC](https://discourse.cmake.org/t/sarif-viewer-for-cdash/13282 "2024-12-29T09:14:05Z")

</div>

Hello, Just wondering if sarif integration is possible in cdash, even for just viewing. This would increase the tools supported by a considerable amount and cover a wide variety of use cases - static analysis, linters, …

---

## [Test.xml documentation](https://discourse.cmake.org/t/test-xml-documentation/12910)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 0\
**Last updated:** [November 7, 2024, 12:48pm UTC](https://discourse.cmake.org/t/test-xml-documentation/12910 "2024-11-07T12:48:05Z")

</div>

Hello, Could you please point me to some documentation on the contents and fields of Test.xml file, output of ctest. Trued to find some information on what “Exit Code” and “Exit Value” entries are, but could not find so…

---

## [How to add multiple test cases (Unity)](https://discourse.cmake.org/t/how-to-add-multiple-test-cases-unity/11726)

<div class="topic-metadata">

**Author:** [@kuch3n](https://discourse.cmake.org/u/kuch3n)\
**Replies:** 1\
**Last updated:** [September 19, 2024, 4:16pm UTC](https://discourse.cmake.org/t/how-to-add-multiple-test-cases-unity/11726 "2024-09-19T16:16:33Z")

</div>

CTest is called with /usr/bin/ctest -j6 -C Debug -T test --output-on-failure --output-junit TestResults.xml and the exectuable is added with add\_test(${test\_name} ${test\_runner\_name}). The TestResults.xml does containt o…

---

## [Cannot have per config CTestCustom files](https://discourse.cmake.org/t/cannot-have-per-config-ctestcustom-files/11152)

<div class="topic-metadata">

**Author:** [@Ahmet\_Bilgili](https://discourse.cmake.org/u/Ahmet_Bilgili)\
**Replies:** 1\
**Last updated:** [July 20, 2024, 1:40pm UTC](https://discourse.cmake.org/t/cannot-have-per-config-ctestcustom-files/11152 "2024-07-20T13:40:45Z")

</div>

I would like to execute some scripts before starting ctest via the CTestCustom file and CTEST\_CUSTOM\_PRE\_TEST. But I cannot differentiate between configurations meaning; if I do “ctest -C RelWithDebInfo”, I would like t…

---

## [ctest presets and --build-and-test](https://discourse.cmake.org/t/ctest-presets-and-build-and-test/7514)

<div class="topic-metadata">

**Author:** [@kisielk](https://discourse.cmake.org/u/kisielk)\
**Replies:** 3\
**Last updated:** [June 11, 2024, 4:59pm UTC](https://discourse.cmake.org/t/ctest-presets-and-build-and-test/7514 "2024-06-11T16:59:56Z")

</div>

I’m trying to use the --build-and-test option with ctest in conjunction with presets. I’m using Ninja Multi-Config as my generator. My test presets include both the configurePreset and configuration fields yet when I try…

---

## [ctest 3.29.2 crash on Windows with oversubscription](https://discourse.cmake.org/t/ctest-3-29-2-crash-on-windows-with-oversubscription/10763)

<div class="topic-metadata">

**Author:** [@FROMAGMA](https://discourse.cmake.org/u/FROMAGMA)\
**Replies:** 3\
**Last updated:** [May 7, 2024, 1:57pm UTC](https://discourse.cmake.org/t/ctest-3-29-2-crash-on-windows-with-oversubscription/10763 "2024-05-07T13:57:24Z")

</div>

Hi, Maybe this is the wrong place to report the following issue: We found a heap corruption in ctest 3.29.2 while executing: ctest --preset windows-debug --parallel 50 on a 2x18core Intel Windows 10 Enterprise machin…

---

## [Exporting a CTest Project](https://discourse.cmake.org/t/exporting-a-ctest-project/10468)

<div class="topic-metadata">

**Author:** [@KUGA2](https://discourse.cmake.org/u/KUGA2)\
**Replies:** 3\
**Last updated:** [April 11, 2024, 12:59am UTC](https://discourse.cmake.org/t/exporting-a-ctest-project/10468 "2024-04-11T00:59:54Z")

</div>

Hi, I have the following use case: Multiarch product (x64, arm64) Testcases that need to run on real arch cpus (QEMU fails) arm cpus are sparse Therefore we build both on x64 with cross compiler. We execute the x64 u…

---

## [MEMORYCHECK\_SANITIZER\_OPTIONS, possible options](https://discourse.cmake.org/t/memorycheck-sanitizer-options-possible-options/10354)

<div class="topic-metadata">

**Author:** [@Vincent\_Hamp](https://discourse.cmake.org/u/Vincent_Hamp)\
**Replies:** 1\
**Last updated:** [April 10, 2024, 10:04pm UTC](https://discourse.cmake.org/t/memorycheck-sanitizer-options-possible-options/10354 "2024-04-10T22:04:45Z")

</div>

What are the possible values of MEMORYCHECK\_SANITIZER\_OPTIONS? There is zero documentation on this… /edit How about adding that link to the docs…?

---

## [Possible to exclude ctest label from "default" ctest execution?](https://discourse.cmake.org/t/possible-to-exclude-ctest-label-from-default-ctest-execution/10392)

<div class="topic-metadata">

**Author:** [@mathomp4](https://discourse.cmake.org/u/mathomp4)\
**Replies:** 1\
**Last updated:** [March 19, 2024, 11:34pm UTC](https://discourse.cmake.org/t/possible-to-exclude-ctest-label-from-default-ctest-execution/10392 "2024-03-19T23:34:56Z")

</div>

I was wondering if it is possible to exclude some ctest labels from the “default” ctest execution. That is when I run: ctest it would not run some tests? I ask because in our code we have some tests that are “big”. Fo…

---

## [add test start time to Test.xml file](https://discourse.cmake.org/t/add-test-start-time-to-test-xml-file/10355)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 1\
**Last updated:** [March 13, 2024, 10:09pm UTC](https://discourse.cmake.org/t/add-test-start-time-to-test-xml-file/10355 "2024-03-13T22:09:24Z")

</div>

Hello, I would like o request if it is possible to add start time stamps of individual tests to the “Test.xml” file. Would be useful to create a execution timeline of tests from this file, since we will have start time …

---

## [ctest complains about the test executable, but then deletes it?](https://discourse.cmake.org/t/ctest-complains-about-the-test-executable-but-then-deletes-it/10344)

<div class="topic-metadata">

**Author:** [@dtgriscom](https://discourse.cmake.org/u/dtgriscom)\
**Replies:** 8\
**Last updated:** [March 13, 2024, 3:47pm UTC](https://discourse.cmake.org/t/ctest-complains-about-the-test-executable-but-then-deletes-it/10344 "2024-03-13T15:47:17Z")

</div>

I’m taking over some code and trying to use it in a cross-platform compilation environment (building on Linux/x86, compiling to ARM). However, when I try to run the tests, ctest complains about the built executable and t…

---

## [CTest combines stdout and stderr, change to allow them to be treated differently](https://discourse.cmake.org/t/ctest-combines-stdout-and-stderr-change-to-allow-them-to-be-treated-differently/9857)

<div class="topic-metadata">

**Author:** [@WilliamGLYork](https://discourse.cmake.org/u/WilliamGLYork)\
**Replies:** 6\
**Last updated:** [February 7, 2024, 5:01pm UTC](https://discourse.cmake.org/t/ctest-combines-stdout-and-stderr-change-to-allow-them-to-be-treated-differently/9857 "2024-02-07T17:01:44Z")

</div>

cmake/Source/CTest/cmProcess.cxx\* //starts line 93 uv\_pipe\_open(pipe\_reader, fds\[0\]); uv\_pipe\_open(pipe\_writer, fds\[1\]); uv\_stdio\_container\_t stdio\[3\]; stdio\[0\].flags = UV\_INHERIT\_FD; stdio\[0\].data.fd = 0; …

---

## [ctest does not show tests when executing in script mode](https://discourse.cmake.org/t/ctest-does-not-show-tests-when-executing-in-script-mode/9860)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 5\
**Last updated:** [February 5, 2024, 8:56pm UTC](https://discourse.cmake.org/t/ctest-does-not-show-tests-when-executing-in-script-mode/9860 "2024-02-05T20:56:03Z")

</div>

Hi, When using ctest like this: ctest -S \<script\> -N Always shows 0 tests selected. Any suggestion are appreciated. Please let me know if i am doing something wrong. Ctest version being used in 3.28.0 Thanks Best r…

---

## [cmake error at message(FATAL\_ERROR "CMake step for ${contentName} failed: ${result}")](https://discourse.cmake.org/t/cmake-error-at-message-fatal-error-cmake-step-for-contentname-failed-result/9898)

<div class="topic-metadata">

**Author:** [@natourand](https://discourse.cmake.org/u/natourand)\
**Replies:** 2\
**Last updated:** [January 23, 2024, 10:53pm UTC](https://discourse.cmake.org/t/cmake-error-at-message-fatal-error-cmake-step-for-contentname-failed-result/9898 "2024-01-23T22:53:17Z")

</div>

hello, I was trying to run cmake on Visual Studio code to use the gtest . I have already downloaded the MinGW compiler on my Windows computer. I also downloaded the relevant extensions in vs code such as cmake and cma…

---

## [Test start time stamp in junit xml output](https://discourse.cmake.org/t/test-start-time-stamp-in-junit-xml-output/9800)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 3\
**Last updated:** [January 13, 2024, 10:34am UTC](https://discourse.cmake.org/t/test-start-time-stamp-in-junit-xml-output/9800 "2024-01-13T10:34:48Z")

</div>

Hi all, Would it be possible to add the timestamp for a test node when the test starts, in the generated junit xml. I would suggest Unix epoch in milliseconds. Think it would be useful in generating a timeline of execut…

---

## [Regex for labels in ctest\_test](https://discourse.cmake.org/t/regex-for-labels-in-ctest-test/9698)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 3\
**Last updated:** [December 24, 2023, 1:14am UTC](https://discourse.cmake.org/t/regex-for-labels-in-ctest-test/9698 "2023-12-24T01:14:26Z")

</div>

Hello, I have several tests described with some of them having multiple labels. I am trying to run tests with multiple labels, like label\_A and label\_B, in ctest\_test(). I am not able to get a regex work for this case, …

---

## [Customizing the junit xml or Jason output of ctest](https://discourse.cmake.org/t/customizing-the-junit-xml-or-jason-output-of-ctest/9638)

<div class="topic-metadata">

**Author:** [@pkiran](https://discourse.cmake.org/u/pkiran)\
**Replies:** 4\
**Last updated:** [December 19, 2023, 3:37am UTC](https://discourse.cmake.org/t/customizing-the-junit-xml-or-jason-output-of-ctest/9638 "2023-12-19T03:37:30Z")

</div>

Hello, Is there a way to add custom fields to the junit or Jason output of a ctest run. For example, fields like the size of executable , ticket id etc . Wondering if such information can be made part of the report. Th…

[Next page](https://discourse.cmake.org/tag/tool-ctest/45.md?match_all_tags=true&page=1&tags%5B%5D=tool%3Actest)
