cmake - Adding a prefix command to all ctest executions - Stack Overflow

I am following the instructions to use the mutation testing framework Mull and integrating it with CMak

I am following the instructions to use the mutation testing framework Mull and integrating it with CMake

.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).

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).

Share Improve this question edited Nov 28, 2024 at 19:20 alfC asked Nov 20, 2024 at 15:39 alfCalfC 16.4k4 gold badges77 silver badges153 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 1 +100

From https://cmake./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./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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742347940a4426927.html

相关推荐

  • cmake - Adding a prefix command to all ctest executions - Stack Overflow

    I am following the instructions to use the mutation testing framework Mull and integrating it with CMak

    3小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信