Ceedling
Ceedling copied to clipboard
Same header file name, need to mock both file, how to?
Here is the my tree view:
/src/A/fileA.h
/src/fileA.h
/src/fileB.c
/src/fileB.h
/test/test_fileB.c
In fileB.c, I have:
#include "A/fileA.h"
#include "fileA.h"
I want to mock both fileA.h How can I do that with ceedling?
Ceddling allows me to add
#include "mock_fileA.h"
So it chooses ONLY the first fileA in the :source:
path
I'm also interested in this issue. if the file name is not unique, CMock just generates the first one found in the path.
So I think there should be a feature that designates subdirectories for the mocks.
@mvandervoord Has there been any more discussion about this? Is there some workaround I'm missing?
@mvandervoord worked on it on last release but failed to add the feature due to too many under-the-hood changes and a solution that can break retro-compatibility. I hope they'll find a solution soon
I am also interested in this feature. Any progress? thanks.
This would be very helpful
@mvandervoord any update on this?
any update on this?
The soon-to-be-released Ceedling has a lot of internal changes that are working towards fixing problems like these. It solves part of the problem, in that it will match the best header file for a given situation now, but we still aren't to a point where we support matching multiple headers of the same name within the same test. That still IS on our goal list, but requires a few more changes.
The upside is the redesigned internals should be much more flexible for all sorts of "fun" situations like these when it's finished.