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

Why my Qt test (which uses a QProcess) fails?

I created a Qt test which invokes another program thanks to a QProcess. After calling the QProcess::start method, my test waits for it to finish with the QProcess::waitForFinished method. When I run this test with Qt Creator, there's no problem. But…
Erwan
  • 41
  • 6
0
votes
0 answers

Cmake Ctest mixed logs

I'm running my tests with --parallel "${JOBS_NUM} (this depends on the system), everything works fine except logs of tested applications - they are mixed, as a result, it's hard to read: example of my tests: test 1: started logs from…
Nemo
  • 3
  • 2
0
votes
0 answers

How to CTest an interactive command line utility?

I am learning CTest over the following code: // A program that echoes lines on stdin back. #include #include int main() { std::string line; do { std::getline(std::cin, line); std::cout << line <<…
Vorac
  • 8,726
  • 11
  • 58
  • 101
0
votes
0 answers

Running gtest using ctest takes a lot of time to finish

I'm using cmake and gtest in my C++ project and TEST_DISCOVER_TESTS to add tests and run it witn ctest. When I'm running the tests with ctest it takes a few minutes to finish but when I run the same tests using binary it takes only a few seconds. As…
Mahashi
  • 119
  • 7
0
votes
0 answers

CTest can not find tests in simple test setup

I am adding unit tests to my library but ctest always says No tests were found!!!. In my top level CMakeLists.txt I have the following option(BUILD_TESTS OFF) if (${BUILD_TESTS}) enable_testing() add_subdirectory(tests) endif() and int…
Symlink
  • 383
  • 2
  • 12
0
votes
2 answers

Registering tests on QTest in CTest apart from executable like GTest realizations

I have an executable with multiple tests written with QTest. The executable is being registered using add_tests(NAME test_name COMMAND test_executable). Obviously, tests will be handled as one in CTest, so it will be difficult to find the problem if…
0
votes
2 answers

Cmake Ctest check substring only

I have an issue with cmake ctest. I'm checking substring in the full string. But got the issue that the string is not found. How can I specify just looking for substring, but not full sting? neg_message="App error: Error…
Nemo
  • 3
  • 2
0
votes
0 answers

Debug multithreaded CTest

We have a legacy code and now trying to upgrade compile from c++98 to c++14 and as a part of the process some unit tests are failing when compiled with new compiler and ran parallel. We are using CTest to run the tests in parallel ctest . -j 10 -O…
BhanuKiran
  • 2,631
  • 3
  • 20
  • 36
0
votes
0 answers

How to create a conan package including tests for a header only library which can be packaged on all platforms

I'm trying to create a header only package with conan which is based on CMake and CTest. It's as empty as possible and just contains two tests with empty main() functions. While conan create . conantest/stable works fine on linux it stop with the…
jesses
  • 559
  • 3
  • 15
0
votes
1 answer

how to organize ctest test fixtures

I have learnt how to use ctest with add_test("base64 conversion" utils.exe) e.g. I would like to know if there is a common pattern to perform several tests with the same executable. I have a util component that does many things, for example base64…
windev92
  • 1
  • 1
0
votes
1 answer

How do I pass the timeout setting of CTest to test binaries?

When running CTest with --timeout 120 (or the default timeout), how is that number passed on to the test binary? I have a C/C++ test binary and it appears that the timeout is neither passed on to the test binary on its command-line, nor its…
Christoph Wintersteiger
  • 8,234
  • 1
  • 16
  • 30
0
votes
1 answer

Ctest get number of tests passed/failed in script

Is there a straightforward way when using ctest to get the number of tests passed (and/or failed) within a script, e.g., BASH, without grep-ping through a generated output file?
Connor Fuhrman
  • 781
  • 6
  • 15
0
votes
1 answer

ctest reports success for test with exit status 1

I have a project with unit tests and when I run ctest (cmake version 3.18.2 on macos), success is reported for all tests. However, if I run one of the tests by itself, it has exit status 1. As far as I know, this shouldn't happen, so what is causing…
Jasper Braun
  • 109
  • 8
0
votes
1 answer

strange behavior of cmake ctest for bigger CTEST_PARALLEL_LEVEL

I am new to the SO. I have a simple unit test code where I am doing following operations : calculating square root of the number using mysqrt library . Using the output of square root, adding this result with same number and display the…
0
votes
1 answer

What does the ctest error "no tests were found" exactly mean?

When running ctest, I get the following error message: Test project /home/path_to_my_project/build No tests were found!!! It is actually unclear what the error exactly means. Following the official documentation, I call include(CTest) in the root…
WaterFox
  • 850
  • 6
  • 18