meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
programming:c:ceedling [2021/04/22 11:07] niziakprogramming:c:ceedling [2021/04/22 12:07] niziak
Line 4: Line 4:
 ===== add .c file  ===== ===== add .c file  =====
  
-When ceedling fails to pickup automatically .c file it can be added to given test by+When ''ceedling'' fails to pickup automatically .c file it can be added to given test by
 <code c> <code c>
 TEST_FILE("source_file_to_compile.c") TEST_FILE("source_file_to_compile.c")
Line 10: Line 10:
  
 ===== cross includes = deep linking ===== ===== cross includes = deep linking =====
-Also ceedling cannot automatically pick ''.c'' files when included .h file depends on another ''.h'' file. + 
-All dependant includes needs to be added manually in test ''.c'' file.+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. 
 + 
 +<code c> 
 +# This will include 20 another headers :) 
 + 
 +#include "cpu_hal.h" 
 + 
 +# To prevent this: 
 +#include "mock_cpu_hal.h 
 +</code> 
 + 
 +===== extern keyword ===== 
 + 
 +By default ''cmock'' will ignore ''extern'' function (is not mocking them). To enable mocking of ''extern'' functions: 
 +<code yaml> 
 +:cmock: 
 +  :treat_externs: :include 
 +</code> 
 + 
 +