Declared here, defined there, Ceedling can't seem to find it #723
-
Using Ceedling and Unity inside VSCode with TestRunner,
I can't seem to get Ceedling to look for Am I missing obvious? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Does
or does it include this:
|
Beta Was this translation helpful? Give feedback.
-
Neither. Yea, that’s the tricky thing I guess. The additional functions are defined in the additional c, but still declared in the file.h. So the only thing to bring in is file.h, and everything in file.c is fine. It’s like Ceedling isn’t importing the additional.c file because it doesn’t have its own additional.h. I tried to explicitly add the file to paths / YAML, no luck. |
Beta Was this translation helpful? Give feedback.
-
You're correct about your assessment. Ceedling isn't pulling in There are a couple solutions. First, you could directly include the C file in your test:
Second, you could create a header for The advantage of this second method is that it would make the functions in |
Beta Was this translation helpful? Give feedback.
You're correct about your assessment. Ceedling isn't pulling in
additional.c
because you haven't told it to. It knows what to import based on the #includes you've provided, and this isn't one of them.There are a couple solutions. First, you could directly include the C file in your test:
Second, you could create a header for
additional.h
, even if it's only used in tests (you could even put it in a test folder, instead of the normal source folder, so long as you tell ceedling that it might be there by adding the path to your includes list.)The advantage of this second method is that it would make the functions in
additional.c
mockable, in the even that any of you…