-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue: Not able use Check-C framework with arm-none-eabi-gcc compiler #321
Comments
The arm-none-eabi-gcc version of GCC uses a non-standard include path. Use command I am not sure where If you will start to use Check, consider building it from scratch with the ARM toolchain. Then you will get the benefit of the library being compiled with the same build options as your main project. You can incorporate Check into you build system easily if you are using e.g. CMake or GNU Autotools. |
hello @mikkoi , Thanks for your response. I build the check with sources, and the check .h files are is present in the /usr/local/include folder. arm-none-eabi-gcc -I/usr/local/include/ -L"/usr/lib" test_lin.c error log: rohit@rohit:~/Rohit_WorkSpace/Unit_testing/LinStack_UnitTesting/lin-stack-slave/tests$ arm-none-eabi-gcc -I/usr/local/include/ -L"/usr/lib" test_lin.c I build the check with the following commands : $ ./configure I also tried to build specifically for the arm-none-eabi-gcc compiler by executing the below command but getting error like : is anything i am missing ? test_lin.c : #include <stdio.h>
} |
I wrote earlier
I was wrong about that. Sorry for the extra trouble. The compiler arm-none-eabi-gcc compiles code directly for 32-bit Arm Cortex-A, Arm Cortex-M, and Arm Cortex-R processor families. We cannot run that code in Ubuntu even if we succeeded in compiling it. The compilation fails because you are using library calls which are not present in that extremely limited libc library which Arm compiler uses (to make the executable smaller and more efficient). You need to use a different approach. Isolate those parts of the code you want to test. Compile and link them separately with the normal GCC processor under normal circumstances. When compiling with normal GCC, it is easy to include Check. AFAIK Check has never been used in an embedded solution project. We are breaking new ground here. I hope you succeed. I will help where I can but I have no experience from embedded code. Good luck! |
Hi,
i am trying to use Check framework for unit testing of C. and i have installed check framework as per the
step given in the below link https://libcheck.github.io/check/web/install.html#aptitude
and trying to compile unit test code using arm-none-eabi-gcc compiler,
but issue is like it is not able to find check.h header file during compilation.
and i have tried to use the same thing with gcc compiler and it is working perfectly fine.
Note :
Environement : Ubuntu 18.04
gcc version : 7.5.0
arm-none-eabi-gcc version : 6.3.1
Console log :
rohit@rohit:~/WorkSpace/Unit_testing/LinStack_UnitTesting/lin-stack-slave/tests$ arm-none-eabi-gcc test_lin.c
test_lin.c:2:19: fatal error: check.h: No such file or directory
#include <check.h>
Kindly help me how to use the check framework with arm-none-eabi-gcc toolchain as i am new to these things.
Thanks in advance
The text was updated successfully, but these errors were encountered: