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

CMake not running tests if tests are defined in subdirectory

I have a project layout like this: . |_ CMakeLists.txt |_ src | |_ CMakeLists.txt | |_ myLib | |_ tests | |_ CMakeLists.txt | |_ add_test(myLibTest my_lib_test) The problem is that if I enable testing in src/CMakelists.txt like…
juzzlin
  • 45,029
  • 5
  • 38
  • 50
0
votes
1 answer

How to suppress "invalid read" warning for GOT in valgrind?

I am running valgrind memcheck as part of my unit tests. Valgrind issues an "Invalid read of size 8" for a specific test views and modifies the GOT (Global Offset Table) of the process. I would like to suppress this warning preferably for just the…
smichak
  • 4,716
  • 3
  • 35
  • 47
0
votes
1 answer

Running verbose cmake tests in Visual Studio

I have a placeholder test setup with cmake and I'm using the Visual Studio (2017) integration. How can I run a test in verbose mode from within VS? Test Explorer
0
votes
1 answer

CDash build ID not set (CTest, CMake)

I have a CDash configured to accept posts for automatic builds and tests. However, when any system attempts to post results to the CDash, the following error is produced. The result is that each result gets posted four times (presumably the original…
taranaki
  • 803
  • 9
  • 15
0
votes
0 answers

How to specify multiple Working directory in set_tests_properties in Ctest

I have a large supporting file placed in another location outside my test Working directory. Working Directory = C:/cmake/src/Test Large Binary file to be parsed = C:/Largefiles/Binary.fft I dont want to copy Binary.fft to…
arun
  • 72
  • 8
0
votes
1 answer

When using CMake + CTest + CDash can I have an optional test fixture?

I am using CMake FIXTURES_SETUP/FIXTURES_REQUIRED to only run tests if an external resource is available. However, the external resource is optional (available on some test machines, but not others) so when the fixture that checks for the resource…
pups
  • 82
  • 7
0
votes
1 answer

Using REQUIRED_FILES for unit tests in cmake

Very short example trying to use REQUIRED_FILES: $ tree . . ├── CMakeLists.txt └── main.cxx $ cat main.cxx int main() { return 0; } $ cat CMakeLists.txt cmake_minimum_required(VERSION 3.10) add_executable(a.out…
Barry
  • 286,269
  • 29
  • 621
  • 977
0
votes
1 answer

Continuous integration: simple framework to test C++ against Octave

I have octave scripts and C++ source code in 2 different git repositories. I would like for every C++ commit - execute regression test suite (cmake/ctest based), which matches C++ output against octave output. And for every octave commit - run…
olegkhr
  • 374
  • 3
  • 8
0
votes
1 answer

Creation of new targets for CTest

What is the approach to create a new target for Ctest? By default, the target 'test' is created and CTest can be run from make test Let say that this command line runs some tests defined like this: ADD_TEST(my_test1 my_exe1 my_arg1)…
Aleph
  • 1,343
  • 1
  • 12
  • 27
0
votes
1 answer

Upload image diff using CTest and CDash

For running automated tests in a C++ application, I would like the application to dump an image and compare it against a baseline image. I saw several examples of this on various CDash dashboards, e.g. this one (link might not be valid for…
Petter Kvalvaag
  • 323
  • 2
  • 11
0
votes
1 answer

Errors while running ctest

When we try running ctest with Catch2 test cases, we got the Errors while running CTest in the last line but the test cases ran properly. After adding the ParseAndAddCatchTests.cmake in…
Suresh Kumar
  • 615
  • 2
  • 8
  • 15
0
votes
1 answer

migrating CMake results in multi-stage Docker build

I have a CMake-based C++ project that I need to integrate into a CI/CD pipeline. The pipeline has two steps, one for building, the other for testing. Creating this environment in a Docker container works like a charm, but results in a 2GB container.…
Ravenwater
  • 735
  • 1
  • 5
  • 14
0
votes
2 answers

Where to create a temporary file from within a test

I have a test, which is run during the standard cmake/ctest process. The problem is that my test needs to create a temporary file (no need to preserve it across different tests), and it fails with the EACCES error code. The following (presumably)…
valdo
  • 12,632
  • 2
  • 37
  • 67
0
votes
1 answer

Dynamic Analysis with Clang - Suppressing Reports in External Libraries Ignored in a CMake project

I am trying to use -fsanitize=address feature in clang compiler, but I am interested in to see my local project errors only, so I will ignore the incoming error from 3rdparty libraries, specifically I have a project configured to ignore the errors…
0
votes
1 answer

Promote cmake ctest to parent level

I'm having trouble calling ctest from the top of a super-project. I'm running a nested project; a project with lots of sub-projects which also sometimes have sub-projects. This is handled with cmake. superproject ├── project1 │ ├──…
Stewart
  • 4,356
  • 2
  • 27
  • 59