Hi,
We have generated a unit_test_support.h header file to include in our embedded project to utilize some Ceedling/Unity workarounds while not changing the structure of the source under test:
#ifndef UNIT_TEST_SUPPORT_H_
#define UNIT_TEST_SUPPORT_H_
// redefined static and assert for unit tests
#ifndef TEST
#define STATIC static
#define FOREVER() 1
#else
#define STATIC
int NumLoops = 0x00;
#define FOREVER() NumLoops--
#undef assert
#include "CException.h"
#define assert(condition) \
if (!(condition)) \
Throw(0)
#endif
#endif
Rather than having to #include this header file in each source code C file, we would like to preinclude it when compiling all files. This is simple to do in our IDE when compiling the SUT. However, we can’t figure out how do add this functionality in the Ceedling environment. We think that the GCC flag we want to add is -include file. How do we add the -include option when the GCC compiler is called during a Ceedling unit test without invalidating the existing compiler flags/options?
Thanks in advance for your assistance.