40 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
0
answers
41
views
clangd LSP with CMock
I’m working on an embedded project that runs on an Infineon TriCore MCU.
The certified TriCore‐GCC and its binary libraries are Windows‐only, but I do most work on Linux.
To get quick syntax checks ...
0
votes
0
answers
55
views
Testing functions with Ceedling using function pointers
Below is the sample function that I want to test using Ceedling:
fsp_err_t half_bridge_reset(const half_bridge_cfg_t* cfg, half_bridge_ctrl_t* ctrl, const ioport_instance_t* io)
{
/* Reset ...
0
votes
0
answers
192
views
Mocks in Ceedling Project – Files Were Not Found
I am trying to write unit tests for files present inside the pmk folder of this project: https://github.com/air-gmv/air/tree/master/air, but I'm having trouble getting mocks to work correctly. My ...
0
votes
0
answers
264
views
Getting an "Undefined reference to '<function name>_CMockExpect'" error
I am using ceedling and CMock for unit testing(I am new to this so the code is very basic). I am trying to build/compile my project but I am getting a list of "undefined reference to" errors....
0
votes
2
answers
754
views
cmock with inline functions
I'm using CMock/Unity inside Ceedling for unit testing an embedded system:
$ ceedling version
Ceedling:: 0.31.1
Unity:: 2.5.4
CMock:: 2.5.4
CException:: 1.3.3
I have a third party ...
2
votes
0
answers
328
views
CMock's behaviour for IgnoreAndReturn
I am currently trying to understand the intricacies of CMock's IgnoreAndReturn feature.
This is the function under test
void USBDriver_Exec(void)
{
uint8_t Val;
// When ...
1
vote
1
answer
1k
views
Why do I have to re-include header files in C when running Ceedling?
I have a C project which I intend to test with Ceedling, CMock, and Unity stack.
I do have an issue when running tests...
My project structure is below
mytest
├── lib
│ ├── bar.c
│ └── ...
0
votes
1
answer
954
views
Ceedling/CMock: Adding va_list to :treat_as_array: produces a TypeError
I am working on developing some unit tests for some non-open source inherited code. For now I have just been testing the ceedling framework, using the autogenerated tests to ensure everything runs as ...
1
vote
1
answer
621
views
how to use gcc to preprocess header only for #ifdef, not for #include and #defines [duplicate]
I have to preprocess a header, during this I want to only process the header for #ifdef, #if defined sections, other sections like Macro expansion and #include sections should not be expanded or ...
1
vote
0
answers
75
views
cmocka: wrapping a Glib library function g_string_append_c() not working
I am running UT test case for syslog-ng in cmocka, upgraded Glib library to 2.71.
I am not able to call wrapper function.
I tried linking option --Wl, wrap=g_string_append_c, wrap=g_string_append in ...
0
votes
0
answers
744
views
Unit test large projects with Ceedling
I've used Ceedling in the past on bare-metal projects that don't have many vendor libraries, so creating unit tests and mocking dependencies was pretty easy.
Now I'm trying to integrate Ceedling on a ...
2
votes
1
answer
2k
views
CMock + Ceedling - how to mock methods imported from external library e.g. <nfc/nfc.h>
I'm using ceedling + Cmock to unit test my methods. I've been following this guide. In my project, I have a foo.h and foo.c file:
foo.c:
#include <nfc/nfc.h>
#include <stdbool.h>
#...
Tung's user avatar
- 5,464
0
votes
1
answer
535
views
Add __wrap prefix to mocked functions with Cmock
I have generated mock_foo.h and mock_foo.c from my foo.h header using Ceedling. The problem is that in generated file there are function names the same as in foo.c. For example, foo_function() is now ...
1
vote
2
answers
2k
views
Ceedling unit testing in a project with FreeRTOS dependency
I'm trying to implement unit tests in Unity (Learn more about Unity) with a little help of CMock (Learn more about CMock). To do that I use the Ceedling tool which combines all Unity components into a ...
0
votes
1
answer
2k
views
Ceedling error when trying to compile/link with xc16-gcc
I am trying to implement test driven development for my Microchip embedded system process and am trying to do that via Ceedling (Unity, CMock, etc.). I have been trying to follow along with this ...