Closed abergerSRS closed 12 months ago
It's possible that the above test and error message are a red-herring. If I instead try to run a test that doesn't include any mocks I still get the internal compiler error: Segmentation fault
, but this when trying to build unity.c:
$ ceedling test:queues
Test 'test_queues.c'
--------------------
Compiling unity.c...
C:/Users/aberger/Documents/Projects/P123/P123-firmware/vendor/ceedling/vendor/unity/src/unity.c: In function 'UnityPrintFloat':
C:/Users/aberger/Documents/Projects/P123/P123-firmware/vendor/ceedling/vendor/unity/src/unity.c:250:5: internal compiler error: Segmentation fault
250 | if (number < 0.0f || (number == 0.0f && 1.0f / number < 0.0f))
| ^~
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
ERROR: Shell command failed.
> Shell executed command:
'gcc.exe -I"test" -I"test/noInline" -I"test/support" -I"source" -I"utilities" -I"drivers" -I"board" -I"test/win32" -I"test/noInline" -I"CM4F_RTCESL_4.5_MCUX/GMCLIB/Include" -I"CM4F_RTCESL_4.5_MCUX/MLIB/Include" -I"C:/Users/aberger/Documents/Projects/P123/P123-firmware/vendor/ceedling/vendor/unity/src" -I"C:/Users/aberger/Documents/Projects/P123/P123-firmware/vendor/ceedling/vendor/cmock/src" -I"build/test/mocks" -DTEST -DCONFIGURATION=2 -DENABLE_SUMDIFF -DUNITY_INCLUDE_DOUBLE -DGNU_COMPILER -g -c "C:/Users/aberger/Documents/Projects/P123/P123-firmware/vendor/ceedling/vendor/unity/src/unity.c" -o "build/test/out/unity.o"'
> And exited with status: [1].
Is this your first test or project has testing already working? Also not sure about your above statement where cmock would break dependency chain, as it could usually be the missing include guard or something...
This project was (and still is) working on a previous machine. I've copied the repo to a new machine, and can't get things working again.
Old machine: Windows 10 Ruby 2.7.2p137 GCC (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
$ gem list ceedling
ceedling (0.30.0)
(in project directory):
$ ceedling version
Ceedling:: 0.28.2
CException:: 1.3.1.18
CMock:: 2.4.4.215
Unity:: 2.4.1.120
New machine: Windows 11 Ruby 2.7.2p137 GCC (Rev3, Built by MSYS2 project) 10.2.0
$ gem list ceedling
ceedling (0.30.0)
(in project directory):
$ ceedling version
Ceedling:: 0.28.2
CException:: 1.3.1.18
CMock:: 2.4.4.215
Unity:: 2.4.1.120
From your report the compiler version changed, so I would look into that, especially since : internal compiler error: Segmentation fault
means that compiler crashed. And based on lines it is with floating points, so maybe you need to enable some flags to add that support?
Yeah, you're right. If I install gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
on the new machine everything works.
It's pretty painful to make sure the entire toolchain (ruby, ceedling, gcc) is identical to get things working on a separate development machine. Any suggestions?
Use Docker containers and you get Continues integration for free.
It seems that I have a situation where CMock is following the
#include
s of a mocked header, and ends up with a compiler error.I have a test file (test_ADC.c) that begins with:
My instrument_noinline.h begins
And when I try to run
ceedling test:ADC
, I get the following errorMy understanding is that by using
#include "mock_instrument_noinline.h"
, CMock should break the dependency chain at instrument_noinline.h and ignore all of the #includes within that file. Why is it trying to#include "DDS.h"
?