Can ceedling mock support subfolder ? myfolder/mock_myheader.h for example?
Whenever I used Ceedling I get frustrated by the support of the automatic generation of mock files which seem to only work when the header to mock is within the include search path at the root level..
i.e. Ceedling can mock my header using
#include <mock_myheader.h>
as long as I used -Imyfolder in the gcc options, but I need it to be able to support sub-folder this way
no -I
#include <myfolder/mock_myheader.h>
Wondering if this could be added... (if it is already there, please excuse me I am not always using the latest and greatest version and last I attempted this it didn't work.
Hi, @ykoehler. Sorry for the frustration.
This one is tricky. The convention Ceedling uses makes adding elements like mocks to a test executable simple (the alternatives are a pain). But, it is quite limited when it comes to paths in an #include statement. A subdirectory is not only an extension of a search path for the source header file to be mocked. It also becomes a subdirectory for the search path for the generated mock itself. That means creating a mirroring directory structure for the generated mocks and because of internal processing tracking a full file path for each generated mock. This is not impossible but would be a great deal of work to implement.
Could you talk about your projects, directory layout, and needs? Maybe there's a way to do what you need to do without subdirectories for mocks.