Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
a868b2eb
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
1 年多 前同步成功
通知
36
Star
144
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Unity
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a868b2eb
编写于
8月 04, 2017
作者:
M
Mark VanderVoord
提交者:
GitHub
8月 04, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #286 from palaviv/fix-UNITY_OUTPUT_FLUSH
Allow specifying custom header declaration (Thanks!)
上级
c1bc32dc
e56378e4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
13 deletion
+17
-13
examples/unity_config.h
examples/unity_config.h
+6
-4
extras/fixture/rakefile_helper.rb
extras/fixture/rakefile_helper.rb
+1
-1
extras/fixture/test/Makefile
extras/fixture/test/Makefile
+1
-0
src/unity_internals.h
src/unity_internals.h
+7
-7
test/Makefile
test/Makefile
+1
-0
test/rakefile_helper.rb
test/rakefile_helper.rb
+1
-1
未找到文件。
examples/unity_config.h
浏览文件 @
a868b2eb
...
...
@@ -201,10 +201,12 @@
* `stdout` option. You decide to route your test result output to a custom
* serial `RS232_putc()` function you wrote like thus:
*/
/* #define UNITY_OUTPUT_CHAR(a) RS232_putc(a) */
/* #define UNITY_OUTPUT_FLUSH() RS232_flush() */
/* #define UNITY_OUTPUT_START() RS232_config(115200,1,8,0) */
/* #define UNITY_OUTPUT_COMPLETE() RS232_close() */
/* #define UNITY_OUTPUT_CHAR(a) RS232_putc(a) */
/* #define UNITY_OUTPUT_CHAR_HEADER_DECLARATION RS232_putc(int) */
/* #define UNITY_OUTPUT_FLUSH() RS232_flush() */
/* #define UNITY_OUTPUT_FLUSH_HEADER_DECLARATION RS232_flush(void) */
/* #define UNITY_OUTPUT_START() RS232_config(115200,1,8,0) */
/* #define UNITY_OUTPUT_COMPLETE() RS232_close() */
/* For some targets, Unity can make the otherwise required `setUp()` and
* `tearDown()` functions optional. This is a nice convenience for test writers
...
...
extras/fixture/rakefile_helper.rb
浏览文件 @
a868b2eb
...
...
@@ -53,7 +53,7 @@ module RakefileHelpers
defines
=
if
$cfg
[
'compiler'
][
'defines'
][
'items'
].
nil?
''
else
squash
(
$cfg
[
'compiler'
][
'defines'
][
'prefix'
],
$cfg
[
'compiler'
][
'defines'
][
'items'
]
+
[
'UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar'
])
squash
(
$cfg
[
'compiler'
][
'defines'
][
'prefix'
],
$cfg
[
'compiler'
][
'defines'
][
'items'
]
+
[
'UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar'
]
+
[
'UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar\(int\)'
]
)
end
options
=
squash
(
''
,
$cfg
[
'compiler'
][
'options'
])
includes
=
squash
(
$cfg
[
'compiler'
][
'includes'
][
'prefix'
],
$cfg
[
'compiler'
][
'includes'
][
'items'
])
...
...
extras/fixture/test/Makefile
浏览文件 @
a868b2eb
...
...
@@ -6,6 +6,7 @@ endif
CFLAGS
+=
-std
=
c99
-pedantic
-Wall
-Wextra
-Werror
CFLAGS
+=
$(DEBUG)
DEFINES
=
-D
UNITY_OUTPUT_CHAR
=
UnityOutputCharSpy_OutputChar
DEFINES
+=
-D
UNITY_OUTPUT_CHAR_HEADER_DECLARATION
=
UnityOutputCharSpy_OutputChar
\(
int
\)
SRC
=
../src/unity_fixture.c
\
../../../src/unity.c
\
unity_fixture_Test.c
\
...
...
src/unity_internals.h
浏览文件 @
a868b2eb
...
...
@@ -246,8 +246,8 @@ typedef UNITY_FLOAT_TYPE UNITY_FLOAT;
#define UNITY_OUTPUT_CHAR(a) (void)putchar(a)
#else
/* If defined as something else, make sure we declare it here so it's ready for use */
#if
ndef UNITY_OMIT
_OUTPUT_CHAR_HEADER_DECLARATION
extern
void
UNITY_OUTPUT_CHAR
(
int
)
;
#if
def UNITY
_OUTPUT_CHAR_HEADER_DECLARATION
extern
void
UNITY_OUTPUT_CHAR
_HEADER_DECLARATION
;
#endif
#endif
...
...
@@ -255,22 +255,22 @@ extern void UNITY_OUTPUT_CHAR(int);
#ifdef UNITY_USE_FLUSH_STDOUT
/* We want to use the stdout flush utility */
#include <stdio.h>
#define UNITY_OUTPUT_FLUSH (void)fflush(stdout)
#define UNITY_OUTPUT_FLUSH
()
(void)fflush(stdout)
#else
/* We've specified nothing, therefore flush should just be ignored */
#define UNITY_OUTPUT_FLUSH
#define UNITY_OUTPUT_FLUSH
()
#endif
#else
/* We've defined flush as something else, so make sure we declare it here so it's ready for use */
#if
ndef UNITY_OMIT
_OUTPUT_FLUSH_HEADER_DECLARATION
extern
void
UNITY_O
UTPUT_FLUSH
(
void
)
;
#if
def UNITY
_OUTPUT_FLUSH_HEADER_DECLARATION
extern
void
UNITY_O
MIT_OUTPUT_FLUSH_HEADER_DECLARATION
;
#endif
#endif
#ifndef UNITY_OUTPUT_FLUSH
#define UNITY_FLUSH_CALL()
#else
#define UNITY_FLUSH_CALL() UNITY_OUTPUT_FLUSH
#define UNITY_FLUSH_CALL() UNITY_OUTPUT_FLUSH
()
#endif
#ifndef UNITY_PRINT_EOL
...
...
test/Makefile
浏览文件 @
a868b2eb
...
...
@@ -14,6 +14,7 @@ CFLAGS += -Wbad-function-cast -Wcast-qual -Wold-style-definition -Wshadow -Wstri
#DEBUG = -O0 -g
CFLAGS
+=
$(DEBUG)
DEFINES
=
-D
UNITY_OUTPUT_CHAR
=
putcharSpy
DEFINES
+=
-D
UNITY_OUTPUT_CHAR_HEADER_DECLARATION
=
putcharSpy
\(
int
\)
DEFINES
+=
-D
UNITY_SUPPORT_64
-D
UNITY_INCLUDE_DOUBLE
SRC
=
../src/unity.c tests/testunity.c build/testunityRunner.c
INC_DIR
=
-I
../src
...
...
test/rakefile_helper.rb
浏览文件 @
a868b2eb
...
...
@@ -91,7 +91,7 @@ module RakefileHelpers
defines
=
if
$cfg
[
'compiler'
][
'defines'
][
'items'
].
nil?
''
else
squash
(
$cfg
[
'compiler'
][
'defines'
][
'prefix'
],
$cfg
[
'compiler'
][
'defines'
][
'items'
]
+
[
'UNITY_OUTPUT_CHAR=putcharSpy'
]
+
inject_defines
)
squash
(
$cfg
[
'compiler'
][
'defines'
][
'prefix'
],
$cfg
[
'compiler'
][
'defines'
][
'items'
]
+
[
'UNITY_OUTPUT_CHAR=putcharSpy'
]
+
[
'UNITY_OUTPUT_CHAR_HEADER_DECLARATION=putcharSpy\(int\)'
]
+
inject_defines
)
end
options
=
squash
(
''
,
$cfg
[
'compiler'
][
'options'
])
includes
=
squash
(
$cfg
[
'compiler'
][
'includes'
][
'prefix'
],
$cfg
[
'compiler'
][
'includes'
][
'items'
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录