Ceedling icon indicating copy to clipboard operation
Ceedling copied to clipboard

Same header file name, need to mock both file, how to?

Open biboc opened this issue 7 years ago • 7 comments

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

biboc avatar Dec 15 '17 16:12 biboc

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?

fetiu avatar Apr 24 '20 02:04 fetiu

@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

biboc avatar Apr 24 '20 06:04 biboc

I am also interested in this feature. Any progress? thanks.

ycyang1229 avatar Sep 14 '21 01:09 ycyang1229

This would be very helpful

davewhitters avatar Nov 16 '21 13:11 davewhitters

@mvandervoord any update on this?

biboc avatar Dec 19 '23 09:12 biboc

any update on this?

parmi93 avatar Feb 16 '24 12:02 parmi93

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.

mvandervoord avatar Feb 16 '24 14:02 mvandervoord