clashes.
It should be noted that the exceptions to this are unity_handler.cpp and
unity_handler.h as these deal with Unity/Utest interaction and should be
unique enough in the namespace.
and armcc.
1. Remove use of printf from all code that may be directly or indirectly
invoked from an interrupt context,
2. For occasions where a printf is required and the code in question may
run both inside and outside an interrupt context, add a new interrupt safe
version of printf, utest_printf(). This function will only pass its
arguments down to printf if interrupts are not disabled.
3. In harness.cpp, is_busy() , fix a bug where the function can return
leaving interrupts disabled.
4. In unity_handler.cpp add a new function, utest_safe_putc(), This is
used to override the default putc() function used by Unity. This version
checks that the current code does not have interrupts disabled prior to
outputting the character to the serial port. This overriding is enabled by
adding unity_config.h to the unity code and redefining UNITY_OUTPUT_CHAR
to utest_safe_putc(). The new config file is included in the build by
adding the define UNITY_INCLUDE_CONFIG_H. The Unity changes are submitted
under a separate PR. This change ensures that any Unity ASSERTS executed from
within interrupt context are safe.
from an interrupt context. Where required add flags to functions and check
the values in the case teardowns. This allows validation that the case
callback was invoked without the need for an ASSERT or printf directly in
the callback.
In cases where a printf is still required in a test case but it is unclear
whether the code may or may not get called from interrupt context, a new
printf alternative, utest_printf() should be used instead. This just
checks whether the code is executing in interrupt context and only passes
its arguments to printf if not.
Make the following changes for IAR support:
-define __deprecated_message for IAR
-fix python error in iar.py
-move variable length array in buffered serial from cpp file to c file.
IAR only supports variable length arrays in c.
Updated include files within tests to use subdirectory/header.h
Updated global variables within tests to be static
Fixed indentation issue.
Renamed Timeout class variables to be more meaningful
Moved definition of utest_trace into stack_trace.cpp
Removed unecessary call to .clear() method in utest_add_to_trace()
Changed UTEST_LOG_FUNCTION macro to UTEST_LOG_FUNCTION();