[CMake] Testing our CMake Modules

Ramold, Felix Felix.Ramold at kuka.com
Mon Dec 10 07:30:13 EST 2018


We created multiple additional functions for CMake. They became quite a lot, and we need to (unit) test them.
There are simple ones, that are only variable bases like:
function(join_list LIST GLUE)
These can be tested with a custom CMake Script, that checks the results. For this we also wrote a set of assert-macros.
This becomes way harder when the functions are target based:
function(target_my_custom_property_set TARGET VALUE)
We need a multiple CMakeLists.txt Files that need to be configured. Configuration must succeed or fail with specified messages. Also the result files must be checked.
I wonder, is there an easier way? Is there a existing framework? How does Kitware test the shipped modules?
Note: My original Stackoverflow question: https://stackoverflow.com/questions/51948060/testing-our-cmake-modules

Thanks,
Felix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181210/d60d7d8d/attachment-0001.html>


More information about the CMake mailing list