Ceedling + CMake #967
Replies: 2 comments 2 replies
-
Why don't you drop CMake and just use Ceedling for release build as well? I am still using make for release builds as well - simply because |
Beta Was this translation helpful? Give feedback.
-
We also have this exact setup. Our tests use ceedling (unity, cmock, etc) but in many instances we have to duplicate project settings in both cmake and ceedling to support our customers (internal) and testing, and this is error prone and counter productive. The current setup is that ceedling is configured to (re)build the project and tests and then run the tests. With the migration to ceedlng 1.0 we are now trying to move the building of the library exclusively to cmake and only the tests to ceedling and then link against the cmake library. This works to some extent but now the issue of duplication is becoming even worse. The ideal would be to get the ceedling magic from within CMAKE directly. I don't know how this would look but perhaps a way to define a list of test files (or glob using cmake) and pass that to cmake_ceedling which then creates a cmake target(s) for unity and cmock which will then inherit the cmake project settings. This is very much in line with what @JoseAmador95 has linked in his Related would be to integrate test discovery and running into ctest. PS: I come from a C++ background and I am familiar with protocol buffers, they do something similar although it is an IDL but using a protobuf_generate cmake function it generates source and header files from a list of proto files. I think the same can apply. |
Beta Was this translation helpful? Give feedback.
-
The company I work for uses both Ceedling and CMake for unit tests and build system, respectively. Since there is significant overlap between both, would you consider making Ceedling be driveable from CMake?
Mostly, I would like to have matching build options in both build systems, so taking the compile options from compile_commands.json instead of the project.yml would be ideal. We cannot live without CMock, it is too good. However, making the autocompletion work and build options match CMake is a big task.
I have tried to integrate Unity and CMock in a way similar to what CMake would do, but I think my implementation lacks the magic Ceedling puts on top of Unity + CMock (the test runner generation, autodiscovery, auto-mock with a header prefix, etc...).
This is my current implementation, https://github.com/JoseAmador95/cmake_toolbox.
The actual test files are fully compatible with Ceedling.
Beta Was this translation helpful? Give feedback.
All reactions