meta data for this page
  •  

This is an old revision of the document!


Ceedling

  • support files - additional C files needed for tests but not for project (not added to project src).

add .c file

When ceedling fails to pickup automatically .c file it can be added to given test by

TEST_FILE("source_file_to_compile.c")

cross includes = deep linking

Also ceedling cannot automatically pick .c files when included .h file depends on another .h file. All dependent includes needs to be added manually in test .c file.

This is desired behavior because ceedling gives you control how to treat additional dependeny headers. Perhaps you should break dependency chain by including mocked header.

# This will include 20 another headers :)
 
#include "cpu_hal.h"
 
# To prevent this:
#include "mock_cpu_hal.h

extern keyword

By default cmock will ignore extern function (is not mocking them). To enable mocking of extern functions:

:cmock:
  :treat_externs: :include

enable valgrind

:tools:
  :pre_test_fixture_execute:
    :executable: valgrind
    :arguments:
      - --track-origins=yes
      - --leak-check=full
      - --show-leak-kinds=all
      - --errors-for-leak-kinds=all
      - --error-exitcode=10
      - ${1}
:plugins:
  :enabled:
    - command_hooks