Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
b3bc196a
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
9 个月 前同步成功
通知
29
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b3bc196a
编写于
6月 21, 2016
作者:
M
Mark VanderVoord
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
making new flush routines work under all defined conditions.
上级
c19b5e20
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
24 deletion
+29
-24
auto/generate_module.rb
auto/generate_module.rb
+16
-16
src/unity.c
src/unity.c
+3
-6
src/unity_internals.h
src/unity_internals.h
+8
-2
test/targets/clang_strict.yml
test/targets/clang_strict.yml
+2
-0
未找到文件。
auto/generate_module.rb
浏览文件 @
b3bc196a
...
...
@@ -2,7 +2,7 @@
# Unity Project - A Test Framework for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
# ==========================================
# ==========================================
# This script creates all the files with start code necessary for a new module.
# A simple module only requires a source file, header file, and test file.
...
...
@@ -32,20 +32,20 @@ HELP_TEXT = [ "\nGENERATE MODULE\n-------- ------",
#Built in patterns
PATTERNS
=
{
'src'
=>
{
''
=>
{
:inc
=>
[]
}
},
'dh'
=>
{
'Driver'
=>
{
:inc
=>
[
'%1$sHardware.h'
]
},
'Hardware'
=>
{
:inc
=>
[]
}
'dh'
=>
{
'Driver'
=>
{
:inc
=>
[
'%1$sHardware.h'
]
},
'Hardware'
=>
{
:inc
=>
[]
}
},
'dih'
=>
{
'Driver'
=>
{
:inc
=>
[
'%1$sHardware.h'
,
'%1$sInterrupt.h'
]
},
'dih'
=>
{
'Driver'
=>
{
:inc
=>
[
'%1$sHardware.h'
,
'%1$sInterrupt.h'
]
},
'Interrupt'
=>
{
:inc
=>
[
'%1$sHardware.h'
]
},
'Hardware'
=>
{
:inc
=>
[]
}
'Hardware'
=>
{
:inc
=>
[]
}
},
'mch'
=>
{
'Model'
=>
{
:inc
=>
[]
},
'mch'
=>
{
'Model'
=>
{
:inc
=>
[]
},
'Conductor'
=>
{
:inc
=>
[
'%1$sModel.h'
,
'%1$sHardware.h'
]
},
'Hardware'
=>
{
:inc
=>
[]
}
'Hardware'
=>
{
:inc
=>
[]
}
},
'mvp'
=>
{
'Model'
=>
{
:inc
=>
[]
},
'mvp'
=>
{
'Model'
=>
{
:inc
=>
[]
},
'Presenter'
=>
{
:inc
=>
[
'%1$sModel.h'
,
'%1$sView.h'
]
},
'View'
=>
{
:inc
=>
[]
}
'View'
=>
{
:inc
=>
[]
}
}
}
...
...
@@ -63,7 +63,7 @@ void tearDown(void)
void test_%1$s_NeedToImplement(void)
{
TEST_IGNORE
(
);
TEST_IGNORE
_MESSAGE("Need to Implement %1$s"
);
}
]
...
...
@@ -91,7 +91,7 @@ ARGV.each do |arg|
when
/^(\w+)/
raise
"ERROR: You can't have more than one Module name specified!"
unless
@module_name
.
nil?
@module_name
=
arg
when
/^-(h|-help)/
when
/^-(h|-help)/
puts
HELP_TEXT
exit
else
...
...
@@ -126,7 +126,7 @@ end
@includes
.
merge!
(
@extra_inc
)
unless
@extra_inc
.
nil?
#create triad definition
TRIAD
=
[
{
:ext
=>
'.c'
,
:path
=>
@path_src
,
:template
=>
TEMPLATE_SRC
,
:inc
=>
:src
,
:boilerplate
=>
@boilerplates
[
:src
]
},
TRIAD
=
[
{
:ext
=>
'.c'
,
:path
=>
@path_src
,
:template
=>
TEMPLATE_SRC
,
:inc
=>
:src
,
:boilerplate
=>
@boilerplates
[
:src
]
},
{
:ext
=>
'.h'
,
:path
=>
@path_inc
,
:template
=>
TEMPLATE_INC
,
:inc
=>
:inc
,
:boilerplate
=>
@boilerplates
[
:inc
]
},
{
:ext
=>
'.c'
,
:path
=>
@path_tst
+
'Test'
,
:template
=>
TEMPLATE_TST
,
:inc
=>
:tst
,
:boilerplate
=>
@boilerplates
[
:tst
]
},
]
...
...
@@ -159,7 +159,7 @@ if @destroy
file
=
filespec
[
:path
]
if
File
.
exist?
(
file
)
if
@update_svn
`svn delete
\"
#{
file
}
\"
--force`
`svn delete
\"
#{
file
}
\"
--force`
puts
"File
#{
file
}
deleted and removed from source control"
else
FileUtils
.
remove
(
file
)
...
...
@@ -182,13 +182,13 @@ end
files
.
each_with_index
do
|
file
,
i
|
File
.
open
(
file
[
:path
],
'w'
)
do
|
f
|
f
.
write
(
file
[
:boilerplate
]
%
[
file
[
:name
]])
unless
file
[
:boilerplate
].
nil?
f
.
write
(
file
[
:template
]
%
[
file
[
:name
],
file
[
:includes
].
map
{
|
f
|
"#include
\"
#{
f
}
\"\n
"
}.
join
,
f
.
write
(
file
[
:template
]
%
[
file
[
:name
],
file
[
:includes
].
map
{
|
f
|
"#include
\"
#{
f
}
\"\n
"
}.
join
,
file
[
:name
].
upcase
]
)
end
if
(
@update_svn
)
`svn add
\"
#{
file
[
:path
]
}
\"
`
`svn add
\"
#{
file
[
:path
]
}
\"
`
if
$?
.
exitstatus
==
0
puts
"File
#{
file
[
:path
]
}
created and added to source control"
else
...
...
src/unity.c
浏览文件 @
b3bc196a
...
...
@@ -9,10 +9,7 @@
/* If omitted from header, declare overrideable prototypes here so they're ready for use */
#ifdef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION
int
UNITY_OUTPUT_CHAR
(
int
);
#endif
#ifdef UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION
int
UNITY_OUTPUT_FLUSH
(
void
);
void
UNITY_OUTPUT_CHAR
(
int
);
#endif
/* Helpful macros for us to use here */
...
...
@@ -338,7 +335,7 @@ void UnityConcludeTest(void)
Unity
.
CurrentTestFailed
=
0
;
Unity
.
CurrentTestIgnored
=
0
;
UNITY_PRINT_EOL
();
UNITY_
OUTPUT_FLUSH
();
UNITY_
FLUSH_CALL
();
}
/*-----------------------------------------------*/
...
...
@@ -1298,7 +1295,7 @@ int UnityEnd(void)
#endif
}
UNITY_PRINT_EOL
();
UNITY_
OUTPUT_FLUSH
();
UNITY_
FLUSH_CALL
();
UNITY_OUTPUT_COMPLETE
();
return
(
int
)(
Unity
.
TestFailures
);
}
...
...
src/unity_internals.h
浏览文件 @
b3bc196a
...
...
@@ -299,9 +299,9 @@ extern void UNITY_OUTPUT_CHAR(int);
#endif
#ifndef UNITY_OUTPUT_FLUSH
/* Default to using
putchar
, which is defined in stdio.h */
/* Default to using
fflush
, which is defined in stdio.h */
#include <stdio.h>
#define UNITY_OUTPUT_FLUSH
()
(void)fflush(stdout)
#define UNITY_OUTPUT_FLUSH (void)fflush(stdout)
#else
/* If defined as something else, make sure we declare it here so it's ready for use */
#ifndef UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION
...
...
@@ -309,6 +309,12 @@ extern void UNITY_OUTPUT_FLUSH(void);
#endif
#endif
#ifndef UNITY_OUTPUT_FLUSH
#define UNITY_FLUSH_CALL()
#else
#define UNITY_FLUSH_CALL() UNITY_OUTPUT_FLUSH
#endif
#ifndef UNITY_PRINT_EOL
#define UNITY_PRINT_EOL() UNITY_OUTPUT_CHAR('\n')
#endif
...
...
test/targets/clang_strict.yml
浏览文件 @
b3bc196a
...
...
@@ -60,6 +60,8 @@ compiler:
-
UNITY_INCLUDE_DOUBLE
-
UNITY_SUPPORT_TEST_CASES
-
UNITY_SUPPORT_64
-
UNITY_OUTPUT_FLUSH
-
UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION
object_files
:
prefix
:
'
-o'
extension
:
'
.o'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录