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
1 answer

pass ARGN to custom script in add_test() of CMake

i want to pass ARGN to a custom run_test.cmake in unit tests. What i do in CMake script is: # 1: message("ARGN: ${ARGN}") add_test(NAME ${_category}/${_test_name}_mpi${_nmpi} WORKING_DIRECTORY "${_target_dir}" COMMAND "${CMAKE_COMMAND}" …
Denis
  • 1,526
  • 6
  • 24
  • 40
0
votes
1 answer

Valgrind changes working directory with CTest in KDevelop

I am starting a test with Helgrind using Ctest: find_program(VALGRIND_EXECUTABLE valgrind) message(STATUS "Valgrind in ${VALGRIND_EXECUTABLE}") configure_file(project.supp project.supp) set(BOOST_TEST_ARGS…
Baradé
  • 1,290
  • 1
  • 15
  • 35
0
votes
0 answers

How to display plots in Jenkins of measured durations from tests in C++ over multiple builds

I have multiple test cases which actually measure the duration of a calculation using Boost timers. The test cases are defined using Boost Test. For running the tests I use CTest since I use CMake. The tests are all specified with add_test(). Since…
Baradé
  • 1,290
  • 1
  • 15
  • 35
0
votes
0 answers

cmake - Using --build-and-test on add_test to build an executale

I am asking this to verify that my code is implemented correctly. If it is, then that more than likely means that my library linkage is incorrect at some point, which narrows down the problem. I'm getting the following errors upon trying to build my…
assignment_operator
  • 1,213
  • 4
  • 12
  • 14
0
votes
0 answers

How can I write a CMake test that will show build errors?

I currently have this ingenious code that adds my single-source-file tests to my CMake project: function(runtime_test test_dir test_name) add_executable(${test_name} EXCLUDE_FROM_ALL ${TEST_ROOT}/${test_dir}/${test_name}.c++…
rubenvb
  • 74,642
  • 33
  • 187
  • 332
0
votes
0 answers

How to add new test to already configured ctest suite?

I have a c++ project which has a test suite with already configured scripts. if i run ctest -V it normally check all test available in a directory. I have written a new test and saved it in the same directory but if I run ctest -V -R newtest , i…
user166289
  • 113
  • 5
0
votes
1 answer

CMake project with testing

I'm making a project with cmake and I want to add tests. This is my first time using cmake, so I'm kinda walking in the dark. Does anyone have any examples on how to start this procedure, or an open source project I could look at? Thx
pAlma
  • 11
  • 1
0
votes
2 answers

ctest create_test_sourcelist with fortran and char**

I have some fortran tests I would like to run in CTest using create_test_sourcelist. This is a utility that creates a driver in C or C++, which calls the fortran test routines and expects the signature: int fortname(int argv, char** argc) Can…
Eli S
  • 1,379
  • 4
  • 14
  • 35
-1
votes
1 answer

CMake/CTest DEPENDS on add_executable or custom_target

How can I force an add_test() to build an add_executable() or add_custom_target() target before it runs? I have a very complicated cmake flow because some of my binaries (created with add_executable() on the host GENERATE source code that I use in…
Lance E.T. Compte
  • 932
  • 1
  • 11
  • 33
-1
votes
1 answer

CMake: PASS_REGULAR_EXPRESSION for stderr

I would like PASS_REGULAR_EXPRESSION to also check stderr. Is it possible? I tried the following: add_test(NAME test COMMAND executable) set_tests_properties(test PROPERTIES WILL_FAIL true PASS_REGULAR_EXPRESSION "I was printed to stderr" ) but…
Aleksander Krauze
  • 3,115
  • 7
  • 18
-1
votes
1 answer

Azure devops publish test results with links to requirement

I'm currently using cTest to publish test results from google test into azure. Is there any way i can decorate my test so it comes up already linked to a requirement. without manually having to link it in azure? Edit: I'm using gtest recordproperty…
schultz
  • 316
  • 2
  • 14
-1
votes
1 answer

CMake UnitTest on x86 in ARM project

I run a Cortex-M Project (ARM). Here, I would like to use the CMake feature add_test where I then can go ahead and call make test. This works just fine. The issue I'm having is that the unit test I've added shall run on my PC (x86) not on ARM,…
user654789384
  • 305
  • 1
  • 4
  • 21
-1
votes
1 answer

Cmake/Ctest test failure when initializing googletest

I am trying to integrate Ctest and googletest in my project. I included googletest in my project as described in https://crascit.com/2015/07/25/cmake-gtest/. I created a new test folder with a CoreTest.cpp and a CMakeLists.txt. The CMakeLists…
Guillaume
  • 197
  • 2
  • 12
1 2 3
19
20