提交 8efa8ffc 编写于 作者: F Fabian Zahn

Removed UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION to simplify the behaviour

上级 d9cd6988
...@@ -248,7 +248,8 @@ _Example:_ ...@@ -248,7 +248,8 @@ _Example:_
Say you are forced to run your test suite on an embedded processor with no Say you are forced to run your test suite on an embedded processor with no
`stdout` option. You decide to route your test result output to a custom serial `stdout` option. You decide to route your test result output to a custom serial
`RS232_putc()` function you wrote like thus: `RS232_putc()` function you wrote like thus:
#include "RS232_header.h"
...
#define UNITY_OUTPUT_CHAR(a) RS232_putc(a) #define UNITY_OUTPUT_CHAR(a) RS232_putc(a)
#define UNITY_OUTPUT_START() RS232_config(115200,1,8,0) #define UNITY_OUTPUT_START() RS232_config(115200,1,8,0)
#define UNITY_OUTPUT_FLUSH() RS232_flush() #define UNITY_OUTPUT_FLUSH() RS232_flush()
...@@ -256,10 +257,7 @@ Say you are forced to run your test suite on an embedded processor with no ...@@ -256,10 +257,7 @@ Say you are forced to run your test suite on an embedded processor with no
_Note:_ _Note:_
`UNITY_OUTPUT_FLUSH()` can be set to the standard out flush function simply by `UNITY_OUTPUT_FLUSH()` can be set to the standard out flush function simply by
specifying `UNITY_USE_FLUSH_STDOUT`. No other defines are required. If you specifying `UNITY_USE_FLUSH_STDOUT`. No other defines are required.
specify a custom flush function instead with `UNITY_OUTPUT_FLUSH` directly, it
will declare an instance of your function by default. If you want to disable
this behavior, add `UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION`.
##### `UNITY_WEAK_ATTRIBUTE` ##### `UNITY_WEAK_ATTRIBUTE`
......
...@@ -241,30 +241,30 @@ typedef UNITY_FLOAT_TYPE UNITY_FLOAT; ...@@ -241,30 +241,30 @@ typedef UNITY_FLOAT_TYPE UNITY_FLOAT;
* Output Method: stdout (DEFAULT) * Output Method: stdout (DEFAULT)
*-------------------------------------------------------*/ *-------------------------------------------------------*/
#ifndef UNITY_OUTPUT_CHAR #ifndef UNITY_OUTPUT_CHAR
/* Default to using putchar, which is defined in stdio.h */ /* Default to using putchar, which is defined in stdio.h */
#include <stdio.h> #include <stdio.h>
#define UNITY_OUTPUT_CHAR(a) (void)putchar(a) #define UNITY_OUTPUT_CHAR(a) (void)putchar(a)
#else #else
/* If defined as something else, make sure we declare it here so it's ready for use */ /* If defined as something else, make sure we declare it here so it's ready for use */
#ifdef UNITY_OUTPUT_CHAR_HEADER_DECLARATION #ifdef UNITY_OUTPUT_CHAR_HEADER_DECLARATION
extern void UNITY_OUTPUT_CHAR_HEADER_DECLARATION; extern void UNITY_OUTPUT_CHAR_HEADER_DECLARATION;
#endif #endif
#endif #endif
#ifndef UNITY_OUTPUT_FLUSH #ifndef UNITY_OUTPUT_FLUSH
#ifdef UNITY_USE_FLUSH_STDOUT #ifdef UNITY_USE_FLUSH_STDOUT
/* We want to use the stdout flush utility */ /* We want to use the stdout flush utility */
#include <stdio.h> #include <stdio.h>
#define UNITY_OUTPUT_FLUSH() (void)fflush(stdout) #define UNITY_OUTPUT_FLUSH() (void)fflush(stdout)
#else #else
/* We've specified nothing, therefore flush should just be ignored */ /* We've specified nothing, therefore flush should just be ignored */
#define UNITY_OUTPUT_FLUSH() #define UNITY_OUTPUT_FLUSH()
#endif #endif
#else #else
/* We've defined flush as something else, so make sure we declare it here so it's ready for use */ /* If defined as something else, make sure we declare it here so it's ready for use */
#ifdef UNITY_OUTPUT_FLUSH_HEADER_DECLARATION #ifdef UNITY_OUTPUT_FLUSH_HEADER_DECLARATION
extern void UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION; extern void UNITY_OUTPUT_FLUSH_HEADER_DECLARATION;
#endif #endif
#endif #endif
#ifndef UNITY_OUTPUT_FLUSH #ifndef UNITY_OUTPUT_FLUSH
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册