Questions tagged [ctest]

Is the CMake test driver program.

Is the CMake test driver program. Many CMake command related to testing are related to CTest, too.

Most of the documentation is part of CMake's documentation, like the documentation concerning the CTest executable.

298 questions
0
votes
0 answers

Catch2 special characters in TEST_CASE name

I'm using CMake's 3.18 CTest with the Catch2 3.1.1 framework for testing purposes, and am currently having problems finding what the valid characters are in Catch2's macro TEST_CASE's name parameter. For instance, I created a test…
user3007875
  • 123
  • 7
0
votes
0 answers

cmake add_test NAME warnings

I have a very strange warning which appears when i run ctest : Syntax Warning in cmake code at my_build_path/CTestTestfile.cmake:7:10 A future version of CMake may treat unquoted argument: [=[myTest]=] as an opening long bracket. Double-quote…
Sedji Aka
  • 217
  • 2
  • 10
0
votes
0 answers

Passing valgrind flags from cmake

Complementary to this question, how can I pass flags to valgrind from cmake? # enable valgrind checks set(CTEST_MEMORYCHECK_TYPE "valgrind") set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--leak-check=no") According to the docs, The lines above should…
OrenIshShalom
  • 5,974
  • 9
  • 37
  • 87
0
votes
1 answer

Separating of tests build form application build in CI/CD without rebuilding

I have a project with files: main.cpp - application sum.h sum.cpp tester.cpp - tester application I build it with CMake, CMakeLists.txt: cmake_minimum_required(VERSION 3.10) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set…
amplifier
  • 1,793
  • 1
  • 21
  • 55
0
votes
0 answers

Since include(CTest) internally invokes enable_testing(), does it mean that it's no meaning to manually invoke enable_testing()?

As per this document,which says that: enable_testing() This command is automatically invoked when the CTest module is included, except if the BUILD_TESTING option is turned off. And this post also clearly states the same meaning, which says…
John
  • 2,963
  • 11
  • 33
0
votes
1 answer

CTest output and log file with words cut off

I run the following command: $> ctest -V -R path_unittest and get the following failure message: 2: /path_to_spec/path_unittest.cpp:80: ERROR: CHECK( lines[0] == "test,test1,test2" ) is NOT correct! == test,test1,test2 )st,test1,test2 2: 2:…
ewhiting
  • 244
  • 1
  • 10
0
votes
2 answers

How to force run a disabled test from ctest?

I have a c++ project that leverages cmake, ctest, and gtest. One of my tests needs to be disabled for the purposes of regressions, but I would like to run it manually. I disabled it by using the gtest trick of naming the test…
CraigDavid
  • 1,046
  • 1
  • 12
  • 26
0
votes
0 answers

CMake's CTest fails to run CxxTest using an emulator as specified by CMAKE_CROSSCOMPILING_EMULATOR

I'd like to run our cross-compiled unit test suite on my host system using qemu and invoke the tests with CTest. For that purpose I've configured and set up CMake with the necessary toolchain information, such as: CMAKE_SYSTEM_PROCESSOR: armv5e-our,…
apprentice
  • 21
  • 3
0
votes
0 answers

Cmake: The following tests FAILED

thanks in advance for help. I need to compile and Debian package cmake 3.24 on Debian buster for debugging purposes. The compilation runs smoothly, but the testing fails with these results: The following tests FAILED: 152 -…
Deyaa
  • 11
  • 2
0
votes
1 answer

How to set working folder when running ctest

I want to set correct the working folder for my test. It should be the same folder as where my test executable is generated. The problem is setting the correct build config to the working folder. This is the cmake code that adds my test: …
Mogu
  • 3
  • 3
0
votes
1 answer

Why is ctests passing this "fail" test even when FAIL_REGULAR_EXPRESSION doesn't match?

I added a simple test to ctest with the following lines in a .cmake file: add_test( NAME ktxsc-test-many-in-one-out COMMAND ktxsc -o foo a.ktx2 b.ktx2 c.ktx2 ) set_tests_properties( ktxsc-test-many-in-one-out PROPERTIES WILL_FAIL TRUE …
msc
  • 1,549
  • 2
  • 12
  • 19
0
votes
0 answers

Prevent leaks commands from hanging with CTest

I'm trying to write CMake tests to detect leaks using the leaks command line tool that comes with XCode on macOS. I've been using LSAN with the Homebrew install of LLVM, but the run times on my M1 are 100x more than what they are on an amd64…
mmdski
  • 96
  • 5
0
votes
1 answer

ctest and MPI parallel tests

I'm trying to build some tests with googleTest which should test some MPI parallel code. Ideally I want our CI server to execute them through ctest. My naive approach was to simply call ctest with MPI: mpirun -n 3 ctest However, this results in…
Seriously
  • 884
  • 1
  • 11
  • 25
0
votes
1 answer

How do i generate core dump files from unit tests ran through ctest?

I am having a problem with unit tests failing randomly with seg faults and I cant figure out how to generate core dumps from those tests. I am using cmake and ctest 3.21.1 to run those tests, and the tests are written using the gtest framework. I…
0
votes
1 answer

CTest.exe on Windows splits PATH environment property on semicolons

I have a Jenkins pipeline which runs tests on a Windows VM using ctest.exe in a bat script, like this: // Run all tests in parallel, timeout after 1 hour, exclude any tests needing opengl bat ''' "C:/Program Files/CMake/bin/ctest.exe" --timeout 3600…