Questions tagged [ceedling]

Build system for C meant to be used with unit testing frameworks and libraries Unity, CMock and CException. The [ceedling] tag should be used only where the build system itself is of relevance, consider using tags [unity-test-framework], [cmock] and [cexception] instead.

41 questions
3
votes
0 answers

ceedling/cmock: mocking variadic functions, or va_list parameter

I tried to mock this code: int myPrintf(const char *fmt, ...); int myVprintf(const char *fmt, va_list args); for both functions some wrong code is generated. For example: typedef int (* CMOCK_myPrintf_CALLBACK)(const char* fmt, int…
mastupristi
  • 1,240
  • 1
  • 13
  • 29
3
votes
2 answers

How can I activate ceedling trace?

I am using ceedling for unit testing in a firmware I am working on. I would like to see all command line option ceedling uses when invoking the compiler. I tried to use the option --trace, but so for I have not found any difference. ceedling…
3
votes
2 answers

Ceedling doesn't create Rakefile

I am trying to use Ceedling to create unit tests for my C-project. I wrote in terminal: -ceedling new My_Project_Name Ceedling creates a folder with name "My_Project_Name". But there is no Rakefile in this folder. What's wrong?
2
votes
2 answers

Unit Testing in C scope pointer issue

I am trying to implement unit testing in C using Ceedling. struct Person *list; /* TASK_FIND_BY */ void test_main_task_find_by_normal(void) { char *string = (char *)malloc(sizeof(char)); struct Person new_list_instance; struct Person…
Mykolas D.
  • 43
  • 5
2
votes
0 answers

Ceedling Tests without setUp

I am using Ceedling for C unit tests and I want to add a module function to the setUp function. But before I use it, I want to test the function without the setUp function. Is there any way to call a test function without the setUp function. The…
I_gamer
  • 21
  • 3
2
votes
2 answers

Compiler flag definitions with Ceedling

I have embedded system project, which I'm testing with Ceedling (=Unity and Cmock). In one test case code under test is that simple: uint32_t zero = eeprom_read_dword((uint32_t*)&non_volatile_zero); sprintf(output, "%lu", zero); As embedded system…
Tumbelo
  • 67
  • 10
2
votes
1 answer

organizing code into modular, self contained blocks

I am seeking help from the wisdomous. :-) This is less of a technical help about testing itself and more of a code organization issue. I m working on a project with an STM32 using the libopencm3 HAL and ceedling as the test suite. I m keeping the…
2
votes
4 answers

Testing a function with static global variable in Ceedling

How can I write a test in Ceedling for a function that uses static global variable? I would like to test for each possible value of the variable to achieve a good test coverage. //Pseudo code for file_under_test.c static int global_var; int…
Nitesh
  • 31
  • 1
  • 5
2
votes
0 answers

Environment variable in YAML file for Ceedling not evaluated

I have a Ceedling project for which i want to setup ceedling paths which are not hardcoded. For this I tried both ways - :environment: - :CEEDLING: - my_ceed/ceedling and :environment: - :CEEDLING: - "#{ENV['CEEDLING_PATH']}" and…
aji kka
  • 21
  • 2
2
votes
1 answer

Use Ceedling / Rake for building a shared library and executable

I recently found Ceedling (https://github.com/ThrowTheSwitch/Ceedling) , a nice rake based tool to build and unit test C projects. As I played a little with it I had a generally positive experience and thought that I might start my next C project…
wirrbel
  • 3,173
  • 3
  • 26
  • 49
1
vote
1 answer

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 │   └── include │   └── bar.h ├──…
6b86b273ff
  • 11
  • 2
1
vote
1 answer

CMock + Ceedling - how to mock methods imported from external library e.g.

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 #include #include "foo.h" void do_something_with_nfc() { //... other…
Tung
  • 5,334
  • 1
  • 34
  • 41
1
vote
2 answers

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 one framework (Learn more about…
VIPPER
  • 326
  • 4
  • 24
1
vote
2 answers

How to run stm32 unit tests on Linux PC?

I am trying to unit test (using unity+ceedling) some STM32 code on my linux machine, but every time I access any register the code fails with this error: > Produced no final test result counts in $stdout: Segmentation fault (core dumped) > And…
nero
  • 23
  • 1
  • 3
1
vote
2 answers

Ceedling/CMock: how to make parts of a .h file visible for Cmock only

In my module there are function like macros. This is no obstacle for a module test, but it is an obstacle for other modules which include this module. My question: is there a way to make a part of the .h file visible for CMock only?…
Schmorli
  • 11
  • 3
1
2 3