Open ajmilford opened 7 years ago
That's not an error I've seen before. I'm assuming your first module had a working test or two, though, so that suggests it is likely something in this test module specifically. Can you post your test here? If you're not comfortable doing that, can you send it to me directly? Or, even less revealing, can you just send the top of it (including all your includes, etc, but before the tests themselves)?
Attached the three test files and the three modules they are to test (all renamed .txt to allow dag and drop upload).
I found if I do rake test:measure it still gives the same compilation error
Thanks
test_audio.c.txt test_measure.c.txt test_signal.c.txt audio.c.txt measure.c.txt signal.c.txt
But the other two modules work okay individually?
I thought audio was working, and it was before I added the two new tests But then I did rake clean and now audio does not work either, it now gives the same compilation error!
It's interesting that the test for signal is the one that works. Your test_signal.c file includes "signal.h", which might be confused with
Do your other modules start working if you start including
That's it - many thanks!
Renamed my project signal.h to something else and now all tests work again!
Clearly it was finding my local signal.h in preference to the system
So I guess I need to make sure any source/header files in my project aren't the same as any system files - or can it be configured so that
looks in the system folders whereas
looks in my project folders? I seem to remember vaguely from many years ago some C compilers doing that but I don't know if gcc can do that?
Thanks anyway for your pointers.
I'm not sure. I honestly thought most C compilers (gcc included) would look locally first for "" style includes and at the system folders first for <> style includes... but that doesn't appear to be the case from your example. I'll do a bit of poking around and see if there is something we could be calling better to make that happen.
Looking at the docs for gcc (I think other compilers will vary on this topic), The "" includes will search the local directory and then the system directories. The <> will jump straight to system directories.
Sounds great, right?
BUT, if you add -I includes (as Ceedling does), to look in more directories, it gets a bit more tricky. For "" those directories are checked after the local directory and before the system. For <> They are checked before the system, which I believe is the problem we are seeing.
I think the solution is to stop Ceedling from including the -I calls when it's angle brackets. I think the side effect of this, though, would be that CMock would no longer be able to mock system files.
Anyone have other ideas?
New to ceedling
Added first module and all worked fine. Now added second module and when I try rake test:all I get a compilation error in the second module:
Test 'test_measure.c'
Generating runner for test_measure.c... Compiling test_measure_runner.c... In file included from /usr/include/setjmp.h:10:0, from C:/Project_890/300_Software/301_firmware/LiIon/vendor/ceed ling/vendor/unity/src/unity_internals.h:14, from C:/Project_890/300_Software/301_firmware/LiIon/vendor/ceed ling/vendor/unity/src/unity.h:16, from build/test/runners/test_measure_runner.c:22: /usr/include/machine/setjmp.h:380:66: error: 'sigset_t' undeclared here (not in a function) typedef _JBTYPE sigjmp_buf[_JBLEN+1+((sizeof (_JBTYPE) + sizeof (sigset_t) - 1)
ERROR: Shell command failed.
rake aborted!
What have I done wrong?