0

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 executing the test using the mull-runner. For example:

$ mull-runner-12 test/my_test.exe

I have many tests in my project, and I simply usually run all of them with ctest.

Is there a way to tell ctest, from the command, to add a prefix to all execution commands? (in this case the prefix will be mull-runner-12).

0

1 Answer 1

1
+100

From https://cmake.org/cmake/help/latest/command/add_test.html#command:add_test :

Added in version 3.29: The target's TEST_LAUNCHER, if set, will be used to launch the command:

<launcher> <command> 

From https://cmake.org/cmake/help/latest/prop_tgt/TEST_LAUNCHER.html#prop_tgt:TEST_LAUNCHER :

This property is initialized by the value of the CMAKE_TEST_LAUNCHER ...

Do make -DCMAKE_TEST_LAUNCHER=mull-runner-12.


The other way for previous version of cmake was to overwrite cmake commands, like so:

function(add_test NAME name COMMAND command) _add_test(${NAME} ${name} ${COMMAND} mull-runner-12 ${command} ${ARGV}) endfunction() 

Add such function on top of your CMakeLists.txt or somewhere.

Sign up to request clarification or add additional context in comments.

6 Comments

Ah, pretty recent option. So, this can be only to be set at cmake-time not at ctest-time?
pretty recent option there are ways for previous versions this can be only to be set at cmake-time not at ctest-time? yes
Is this how the variable is used: cmake ... -DCMAKE_TEST_LAUNCHER="mull-runner-11;--strict;--ld-search-path=/lib/x86_64-linux-gnu" ? If so I am not seeing a difference in the executed command: gitlab.com/correaa/boost-multi/-/jobs/8455957522#L833
check your cmake --version
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.