-
Hello all, If a source file that I want to test includes relative paths, is there a way for me to break that dependency somehow?
In module.c:
I was hoping that I could put a fake architecture_specific.h in test/support to break the lower-level dependencies, but my understanding is that since GCC will first try to look for files relative to the current file's directory, it will always find and use the real architecture_specific.h? Therefore, the best approach I could think of is to modify the project build configurations (outside of ceedling), so that src/ is an include path, that way in module.c I can change the line to Please let me know if there are other alternatives, because ideally I would not want to modify the build configurations or the src/ structure. Thank you in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Just don't use relative paths and use proper include directives to point to those directories. Mocks come first so you won't have to worry about taking the wrong one. So in your words: make proper build configurations. It helps when you want to refactor stuff or add more public includes. |
Beta Was this translation helpful? Give feedback.
Just don't use relative paths and use proper include directives to point to those directories. Mocks come first so you won't have to worry about taking the wrong one.
So in your words: make proper build configurations. It helps when you want to refactor stuff or add more public includes.