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

ctest won't output stdout from printf if test fails

In a quite simple test-case, the output of printf() is not shown, if the test fails. I use µunit as a framework and the test routine itself is trivial: static MunitResult test(...) { // Some variable initialisation printf("Test…
Alex_S42
  • 26
  • 4
0
votes
1 answer

Continue after dependent target fails in custom CMake target

I have a regression test suite consisting of multiple custom targets created with add_custom_target(). Moreover there is a "convenience" target regressions to run all regressions. It simply contains all single regression targets as dependency. This…
andreee
  • 4,459
  • 22
  • 42
0
votes
0 answers

Error in condition check inside add_custom_command of CMAKE

I am trying to write unit test cases using CMAKE ctest . I want to do unit test on my custom add and inverse function. The difference between add and inverse test cases add is using two inputs where as inverse is using single input Address of the…
0
votes
1 answer

Installing unit tests for later execution with ctest

I'm building a program intended for execution on another machine, with the target folders being mounted somehow on that other machine (e.g. with NFS or SMB). Since it depends on hardware that's not available on the build machine, make test will…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
0
votes
1 answer

Ctest from within adb shell

How do I run ctests from within the adb shell?
rstr1112
  • 308
  • 4
  • 13
0
votes
1 answer

no matching function for call to ‘std::basic_ifstream::basic_ifstream(std::__cxx11::string&)’ ifstream myfile(filename);

I am using Cmake and Ctest to try and test my code on Travis CI. If I use cmake to test locally I get no errors what so ever and I can make my tests. When running the test through Travis CI I get loads of errors such as this one: error: no matching…
mbh16_x
  • 1
  • 1
0
votes
0 answers

How to run CTest outside of the build folder?

CTest can be run within the build folder using ctest -V, is there an equally simple command to re-run all the tests outside of the build folder? I am not asking about running it inside the build process. I would like to re-run all the tests…
tmaric
  • 5,347
  • 4
  • 42
  • 75
0
votes
0 answers

output compilation error for test target defined in CMakeLists.txt

I have the following CMakeLists.txt: enable_testing() add_executable(legacy_iterator EXCLUDE_FROM_ALL test.cpp) add_test(legacy_iterator_build "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --config "$" --target…
Martin Fehrs
  • 792
  • 4
  • 13
0
votes
2 answers

On Linux, does the remove command "rm" run in the background?

I am trying to run my test cases which are nearly 40k with below scripts. Just showing some part of script - #!/bin/bash # RUN script echo "please run with: nice nohup ./run_script" # working directory where script is…
jailaxmi k
  • 89
  • 3
  • 11
0
votes
2 answers

How do I run tests built using VisualStudio, via CMake/CTest/Catch2 from the CLI?

I'm trying to learn several things at once (arguably my first problem...), namely: unit testing with Catch2 and building with CMake. In the course of my investigations, CTest appeared on the radar as a pre-baked way of managing tests within CMake,…
Edd Inglis
  • 1,067
  • 10
  • 22
0
votes
1 answer

add_custom_command for copy *.y to *.txt file

I am trying to copy the generated *.y output (plane luma values, no header info) to text file using the add_custom_command CMake command. How can I add the copy command in add_custom_command? I want to redirect the generated *.y output to text file.…
jailaxmi k
  • 89
  • 3
  • 11
0
votes
0 answers

Ctest with -j option yeids different results with j1 and jn

I'm setting up unit test framework using ctest and cmake. The idea is to have the test command executed in docker container and the test will execute inside the container. That is the requirement. the add_test looks like this add_test(test_name,…
Suraj
  • 184
  • 1
  • 14
0
votes
1 answer

Can I detect ctest verbosity from inside a test?

Is it possible (via querying an environment variable, or otherwise) to detect the verbosity level that ctest is running under, from within a test? Ie, in my test, I would like to know if "-V/--verbose" or "-VV/--extra-verbose" was passed on the…
Paul Molodowitch
  • 1,366
  • 3
  • 12
  • 29
0
votes
1 answer

How to change Cmake executable running directory

I'm writing tests for a Cmake project. The project contains a library subproject and a test subproject, which is meant to test the library. The tests require to compare some output images to some stored values, so the project contains an…
Ryno
  • 403
  • 2
  • 7
  • 11
0
votes
1 answer

git completion runs cTest

I am in a weird situation under Ubuntu 18.04.2 LTS (using bash) : I installed git via apt-get and everything works fine. However, when I want to autocomplete commands via git (I did not do anything for this to work, it is just a reflex to hit tab…
Scrimbibete
  • 182
  • 8