Commit Graph

11 Commits (36e29b4bed4c27911d1fb2f53b249bef354bf7cb)

Author SHA1 Message Date
Anna Bridge bcebaa559f Renamed utest files to add a prefix of 'utest_' to prevent namespace
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.
2016-06-09 18:41:38 +01:00
Anna Bridge 50f1c178e9 Review comments: Re-implemented utest_printf to use RawSerial.
Re-implemented utest_safe_putc() to use Rawserial.
Minor cosmetic changes.
2016-06-08 18:01:27 +01:00
Anna Bridge 0ccdfe3ca2 Updates to make utest thread safe and thus run when compiled with both gcc
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.
2016-06-07 15:56:26 +01:00
Anna Bridge 5e58036974 Update the extern C decalaration. Add __cpluplus block to unity_handler.h
and include that header in unity_handler.cpp.
2016-05-27 14:48:32 +01:00
Anna Bridge 706e5a0473 Fix ARMCC compiler warning: Missing arg type. 2016-05-25 15:48:29 +01:00
Anna Bridge 15e372f6ef Review comment:
Removed superfluous debug prints from harness.cpp.
2016-05-19 16:56:01 +01:00
Anna Bridge 710421d3e8 Code review rework:
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();
2016-05-19 16:56:00 +01:00
Anna Bridge 3de4514068 Added full namespacing to instances of status_t to prevent namespace
collisions with the same type in global C namespace.
2016-05-17 17:58:05 +01:00
Anna Bridge 878ce59fa3 Updated utest ticker scheduler to use the c++ Timeout class rather than
the C based function calls directly into ticker.
Added a software based backtrace functionality, plus utest instrumentation
using that functionality.
2016-05-13 14:09:55 +01:00
Martin Kojtal cfed344dda utest - fix backslash in the utest paths 2015-10-24 00:59:38 +01:00
Martin Kojtal 2c3ad57a32 utest - fix us ticker header file name 2016-04-28 15:58:08 -05:00