Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
be87d790
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看板
提交
be87d790
编写于
5年前
作者:
M
mvandervoord
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add verifyTest option to go with resetTest.
Fix docs.
上级
15631f1c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
28 addition
and
7 deletion
+28
-7
auto/generate_test_runner.rb
auto/generate_test_runner.rb
+10
-1
docs/UnityConfigurationGuide.md
docs/UnityConfigurationGuide.md
+1
-1
extras/fixture/rakefile_helper.rb
extras/fixture/rakefile_helper.rb
+5
-5
src/unity.h
src/unity.h
+12
-0
未找到文件。
auto/generate_test_runner.rb
浏览文件 @
be87d790
...
@@ -37,6 +37,7 @@ class UnityTestRunnerGenerator
...
@@ -37,6 +37,7 @@ class UnityTestRunnerGenerator
setup_name:
'setUp'
,
setup_name:
'setUp'
,
teardown_name:
'tearDown'
,
teardown_name:
'tearDown'
,
test_reset_name:
'resetTest'
,
test_reset_name:
'resetTest'
,
test_verify_name:
'verifyTest'
,
main_name:
'main'
,
# set to :auto to automatically generate each time
main_name:
'main'
,
# set to :auto to automatically generate each time
main_export_decl:
''
,
main_export_decl:
''
,
cmdline_args:
false
,
cmdline_args:
false
,
...
@@ -304,7 +305,7 @@ class UnityTestRunnerGenerator
...
@@ -304,7 +305,7 @@ class UnityTestRunnerGenerator
end
end
def
create_reset
(
output
)
def
create_reset
(
output
)
output
.
puts
(
"
\n
/*=======Test Reset Option=====*/"
)
output
.
puts
(
"
\n
/*=======Test Reset Option
s
=====*/"
)
output
.
puts
(
"void
#{
@options
[
:test_reset_name
]
}
(void);"
)
output
.
puts
(
"void
#{
@options
[
:test_reset_name
]
}
(void);"
)
output
.
puts
(
"void
#{
@options
[
:test_reset_name
]
}
(void)"
)
output
.
puts
(
"void
#{
@options
[
:test_reset_name
]
}
(void)"
)
output
.
puts
(
'{'
)
output
.
puts
(
'{'
)
...
@@ -314,6 +315,13 @@ class UnityTestRunnerGenerator
...
@@ -314,6 +315,13 @@ class UnityTestRunnerGenerator
output
.
puts
(
' CMock_Init();'
)
output
.
puts
(
' CMock_Init();'
)
output
.
puts
(
"
#{
@options
[
:setup_name
]
}
();"
)
output
.
puts
(
"
#{
@options
[
:setup_name
]
}
();"
)
output
.
puts
(
'}'
)
output
.
puts
(
'}'
)
output
.
puts
(
"void
#{
@options
[
:test_verify_name
]
}
(void);"
)
output
.
puts
(
"void
#{
@options
[
:test_verify_name
]
}
(void)"
)
output
.
puts
(
'{'
)
output
.
puts
(
' CMock_Verify();'
)
output
.
puts
(
' CMock_Destroy();'
)
output
.
puts
(
' CMock_Init();'
)
output
.
puts
(
'}'
)
end
end
def
create_run_test
(
output
)
def
create_run_test
(
output
)
...
@@ -463,6 +471,7 @@ if $0 == __FILE__
...
@@ -463,6 +471,7 @@ if $0 == __FILE__
' --main_name="" - redefine main func name to something else'
,
' --main_name="" - redefine main func name to something else'
,
' --test_prefix="" - redefine test prefix from default test|spec|should'
,
' --test_prefix="" - redefine test prefix from default test|spec|should'
,
' --test_reset_name="" - redefine resetTest func name to something else'
,
' --test_reset_name="" - redefine resetTest func name to something else'
,
' --test_verify_name="" - redefine verifyTest func name to something else'
,
' --suite_setup="" - code to execute for setup of entire suite'
,
' --suite_setup="" - code to execute for setup of entire suite'
,
' --suite_teardown="" - code to execute for teardown of entire suite'
,
' --suite_teardown="" - code to execute for teardown of entire suite'
,
' --use_param_tests=1 - enable parameterized tests (disabled by default)'
,
' --use_param_tests=1 - enable parameterized tests (disabled by default)'
,
...
...
This diff is collapsed.
Click to expand it.
docs/UnityConfigurationGuide.md
浏览文件 @
be87d790
...
@@ -429,7 +429,7 @@ will allow you to specify how Unity will treat these assertions.
...
@@ -429,7 +429,7 @@ will allow you to specify how Unity will treat these assertions.
#### `UNITY_SUPPORT_VARIADIC_MACROS`
#### `UNITY_SUPPORT_VARIADIC_MACROS`
This will force Unity to support variadic macros when using it
'
s own built-in
This will force Unity to support variadic macros when using its own built-in
RUN_TEST macro. This will rarely be necessary. Most often, Unity will automatically
RUN_TEST macro. This will rarely be necessary. Most often, Unity will automatically
detect if the compiler supports variadic macros by checking to see if it's C99+
detect if the compiler supports variadic macros by checking to see if it's C99+
compatible. In the event that the compiler supports variadic macros, but is primarily
compatible. In the event that the compiler supports variadic macros, but is primarily
...
...
This diff is collapsed.
Click to expand it.
extras/fixture/rakefile_helper.rb
浏览文件 @
be87d790
...
@@ -55,10 +55,10 @@ def build_compiler_fields
...
@@ -55,10 +55,10 @@ def build_compiler_fields
defines
=
if
$cfg
[
'compiler'
][
'defines'
][
'items'
].
nil?
defines
=
if
$cfg
[
'compiler'
][
'defines'
][
'items'
].
nil?
''
''
else
else
if
$is_windows
decl
=
if
$is_windows
decl
=
'UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar(int)'
'UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar(int)'
else
else
decl
=
'UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar\(int\)'
'UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar\(int\)'
end
end
squash
(
$cfg
[
'compiler'
][
'defines'
][
'prefix'
],
$cfg
[
'compiler'
][
'defines'
][
'items'
]
+
[
'UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar'
]
+
[
decl
])
squash
(
$cfg
[
'compiler'
][
'defines'
][
'prefix'
],
$cfg
[
'compiler'
][
'defines'
][
'items'
]
+
[
'UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar'
]
+
[
decl
])
end
end
...
...
This diff is collapsed.
Click to expand it.
src/unity.h
浏览文件 @
be87d790
...
@@ -40,6 +40,18 @@ void tearDown(void);
...
@@ -40,6 +40,18 @@ void tearDown(void);
void
suiteSetUp
(
void
);
void
suiteSetUp
(
void
);
int
suiteTearDown
(
int
num_failures
);
int
suiteTearDown
(
int
num_failures
);
/*-------------------------------------------------------
* Test Reset and Verify
*-------------------------------------------------------*/
/* These functions are intended to be called before during tests in order
* to support complex test loops, etc. Both are NOT built into Unity. Instead
* the test runner generator will create them. resetTest will run teardown and
* setup again, verifying any end-of-test needs between. verifyTest will only
* run the verification. */
void
resetTest
(
void
);
void
verifyTest
(
void
);
/*-------------------------------------------------------
/*-------------------------------------------------------
* Configuration Options
* Configuration Options
*-------------------------------------------------------
*-------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部