310 questions
0
votes
0
answers
20
views
How to check that a program fails with message [duplicate]
I am writing a command-line utility that when given invalid args should print an error message and return with non-zero exit code. I want to write a test that checks this behaviour.
The details of ...
0
votes
0
answers
25
views
CTests: Cannot create directory /Testing/Temporary
I'm modifying some old ctests scripts to use git instead of svn, and refactoring them a bit.
When I run them, I get
Initial checkout failed!
when running in verbose mode the only error I can find is
...
0
votes
0
answers
21
views
ctest vs jenkins / bamboo
I'm trying to understand the differences between ctest and Bamboo/Jenkins.
I'm a passive user of Bamboo meaning I'm not the one developing on Bamboo, only viewing test results etc. My understanding of ...
0
votes
1
answer
93
views
Adding a prefix command to all ctest executions
I am following the instructions to use the mutation testing framework Mull and integrating it with CMake
https://mull.readthedocs.io/en/latest/tutorials/CMakeIntegration.html
The last step involves ...
2
votes
0
answers
641
views
VsCode's cmake plugin display "[ctest] Folder is not found in Test Explorer"
On vscode(v1.85.1), I installed the extensions CMake(v0.0.17) and CMake Tools(v17.7). I use Windows system, and use vscode to open cmake projects of WSL and remote Linux.
When using vscode to ...
2
votes
1
answer
210
views
Customize CTest properties and labels based on test names
I am discovering gtest tests using gtest_discover_tests(...) I then want to set certain properties and labels based on the test names.
(I have done this before several years ago so I know it's ...
1
vote
1
answer
100
views
Redirect stdout in unit testing with ctest
Writing unit test with ctest. The function to test is doing printout to stdout/stderr.
So, right now, I am having:
typedef struct {
char *stdout_file;
char *stderr_file;
} test_config;
static int ...
0
votes
1
answer
300
views
CMake Tools runs build before running ctest, but I don't want it to / think it doesn't need to
cmake.buildBeforeRun is not working as expected.
I have CMake project with a custom CMake Preset for different builds, Our Unit test are doctest based which we add in ctest using "...
0
votes
1
answer
64
views
--trace-children-skip option is not having any impact with Valgrind
I have a run.sh with: ./opt/exm/bin/exm_daemon
exm_daemon spawns many process.
I run valgrind with options:
sudo valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --trace-children=...
0
votes
0
answers
17
views
CTest: Resources for Fixtures?
I want to be able to run a bunch of tests against databases in parallel. For this, I use a docker postgres image that I can deploy in containers that are mapped to ports 5432+n where 0 <= n <=16....
1
vote
0
answers
313
views
Why does CTest output a junit xml in googletest format or why does Jenkins plugin XUnit think that it is?
I am building a jenkins pipeline job from scratch. Once the product is built, I run the unit tests on it via CTest. The XUnit Jenkins plugin requires a JUint xml file to report the tests on the build ...
0
votes
0
answers
19
views
Test and compiler output
I would like to capture the output of CMake testing. Using Xcode, one can find a file named LastTest which includes most of what I want. But it seems to not include build/link failures. If a test ...
0
votes
0
answers
137
views
How to pass --gtest_filter to ctest
I am migrating one of my test folders to gtest, it includes multiple files each having its own test Fixture.
So far, my -simplified- cmake is :
file(GLOB SOURCES *.c)
set(EXECUTABLE_NAME "mytest&...
1
vote
1
answer
1k
views
CTest: Test not available without configuration
I realize this is a very basic question, but I was unable to fix my problem despite even after reading multiple tutorials, including the official tutorial and the Professional Cmake book.
I am simply ...
1
vote
1
answer
128
views
Why isn't WORKING_DIRECTORY being used in my cmake tests?
I'm trying to set the working directory for a CMake test, but I can't seem to get it to work. Here's the really simple test I'm trying to use:
CMakeLists.txt
cmake_minimum_required(VERSION 3.24)
set (...