Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
28195baa
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
8 个月 前同步成功
通知
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 搜索 >>
提交
28195baa
编写于
12月 10, 2015
作者:
M
Mark VanderVoord
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- Made some tweaks to the way the new detail handling works (to make it look nicer, mostly)
- Fixed a big ugly error in the fancy RUN_TEST handler
上级
dfbf21c2
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
34 addition
and
9 deletion
+34
-9
auto/generate_test_runner.rb
auto/generate_test_runner.rb
+1
-0
src/unity.c
src/unity.c
+5
-2
src/unity_internals.h
src/unity_internals.h
+19
-7
test/expectdata/testsample_mock_cmd.c
test/expectdata/testsample_mock_cmd.c
+1
-0
test/expectdata/testsample_mock_def.c
test/expectdata/testsample_mock_def.c
+1
-0
test/expectdata/testsample_mock_head1.c
test/expectdata/testsample_mock_head1.c
+1
-0
test/expectdata/testsample_mock_new1.c
test/expectdata/testsample_mock_new1.c
+1
-0
test/expectdata/testsample_mock_new2.c
test/expectdata/testsample_mock_new2.c
+1
-0
test/expectdata/testsample_mock_param.c
test/expectdata/testsample_mock_param.c
+1
-0
test/expectdata/testsample_mock_run1.c
test/expectdata/testsample_mock_run1.c
+1
-0
test/expectdata/testsample_mock_run2.c
test/expectdata/testsample_mock_run2.c
+1
-0
test/expectdata/testsample_mock_yaml.c
test/expectdata/testsample_mock_yaml.c
+1
-0
未找到文件。
auto/generate_test_runner.rb
浏览文件 @
28195baa
...
...
@@ -254,6 +254,7 @@ class UnityTestRunnerGenerator
output
.
puts
(
" Unity.CurrentTestLineNumber = TestLineNum;
\\
"
)
output
.
puts
(
" Unity.NumberOfTests++;
\\
"
)
output
.
puts
(
" CMock_Init();
\\
"
)
unless
(
used_mocks
.
empty?
)
output
.
puts
(
" UNITY_CLR_DETAILS();
\\
"
)
unless
(
used_mocks
.
empty?
)
output
.
puts
(
" if (TEST_PROTECT())
\\
"
)
output
.
puts
(
" {
\\
"
)
output
.
puts
(
" CEXCEPTION_T e;
\\
"
)
if
cexception
...
...
src/unity.c
浏览文件 @
28195baa
...
...
@@ -42,6 +42,8 @@ const char UnityStrBreaker[] = "-----------------------";
const
char
UnityStrResultsTests
[]
=
" Tests "
;
const
char
UnityStrResultsFailures
[]
=
" Failures "
;
const
char
UnityStrResultsIgnored
[]
=
" Ignored "
;
const
char
UnityStrDetail1Name
[]
=
UNITY_DETAIL1_NAME
" "
;
const
char
UnityStrDetail2Name
[]
=
" "
UNITY_DETAIL2_NAME
" "
;
#ifdef UNITY_FLOAT_NEEDS_ZERO
// Dividing by these constants produces +/- infinity.
...
...
@@ -368,13 +370,14 @@ static void UnityAddMsgIfSpecified(const char* msg)
#ifndef UNITY_EXCLUDE_DETAILS
if
(
Unity
.
CurrentDetail1
)
{
UnityPrint
(
UnityStrDetail1Name
);
UnityPrint
(
Unity
.
CurrentDetail1
);
UnityPrint
(
UnityStrSpacer
);
if
(
Unity
.
CurrentDetail2
)
{
UnityPrint
(
UnityStrDetail2Name
);
UnityPrint
(
Unity
.
CurrentDetail2
);
UnityPrint
(
UnityStrSpacer
);
}
UnityPrint
(
UnityStrSpacer
);
}
#endif
UnityPrint
(
msg
);
...
...
src/unity_internals.h
浏览文件 @
28195baa
...
...
@@ -423,14 +423,26 @@ int UnityEnd(void);
void
UnityConcludeTest
(
void
);
void
UnityDefaultTestRun
(
UnityTestFunction
Func
,
const
char
*
FuncName
,
const
int
FuncLineNum
);
#ifndef UNITY_EXCLUDE_DETAILS
#define UNITY_CLR_DETAILS() { Unity.CurrentDetail1 = 0; Unity.CurrentDetail2 = 0; }
#define UNITY_SET_DETAIL(d1) { Unity.CurrentDetail1 = d1; Unity.CurrentDetail2 = 0; }
#define UNITY_SET_DETAILS(d1,d2) { Unity.CurrentDetail1 = d1; Unity.CurrentDetail2 = d2; }
#
else
//-------------------------------------------------------
// Details Support
//-------------------------------------------------------
#
ifdef UNITY_EXCLUDE_DETAILS
#define UNITY_CLR_DETAILS()
#define UNITY_SET_DETAIL(d1)
#define UNITY_SET_DETAILS(d1,d2)
#else
#define UNITY_CLR_DETAILS() { Unity.CurrentDetail1 = 0; Unity.CurrentDetail2 = 0; }
#define UNITY_SET_DETAIL(d1) { Unity.CurrentDetail1 = d1; Unity.CurrentDetail2 = 0; }
#define UNITY_SET_DETAILS(d1,d2) { Unity.CurrentDetail1 = d1; Unity.CurrentDetail2 = d2; }
#ifndef UNITY_DETAIL1_NAME
#define UNITY_DETAIL1_NAME "Function"
#endif
#ifndef UNITY_DETAIL2_NAME
#define UNITY_DETAIL2_NAME "Argument"
#endif
#endif
//-------------------------------------------------------
...
...
@@ -569,9 +581,9 @@ extern const char UnityStrErr64[];
#ifdef __STDC_VERSION__
#if __STDC_VERSION__ >= 199901L
#define RUN_TEST(...) UnityDefaultTestRun(RUN_TEST_FIRST(__VA_ARGS__), RUN_TEST_SECOND(__VA_ARGS__))
#define RUN_TEST_FIRST(...) RUN_TEST_FIRST_HELPER(
##
__VA_ARGS__, throwaway)
#define RUN_TEST_FIRST(...) RUN_TEST_FIRST_HELPER(__VA_ARGS__, throwaway)
#define RUN_TEST_FIRST_HELPER(first, ...) (first), #first
#define RUN_TEST_SECOND(...) RUN_TEST_SECOND_HELPER(
##
__VA_ARGS__, __LINE__, throwaway)
#define RUN_TEST_SECOND(...) RUN_TEST_SECOND_HELPER(__VA_ARGS__, __LINE__, throwaway)
#define RUN_TEST_SECOND_HELPER(first, second, ...) (second)
#endif
#endif
...
...
test/expectdata/testsample_mock_cmd.c
浏览文件 @
28195baa
...
...
@@ -7,6 +7,7 @@
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
CMock_Init(); \
UNITY_CLR_DETAILS(); \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
...
...
test/expectdata/testsample_mock_def.c
浏览文件 @
28195baa
...
...
@@ -7,6 +7,7 @@
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
CMock_Init(); \
UNITY_CLR_DETAILS(); \
if (TEST_PROTECT()) \
{ \
setUp(); \
...
...
test/expectdata/testsample_mock_head1.c
浏览文件 @
28195baa
...
...
@@ -7,6 +7,7 @@
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
CMock_Init(); \
UNITY_CLR_DETAILS(); \
if (TEST_PROTECT()) \
{ \
setUp(); \
...
...
test/expectdata/testsample_mock_new1.c
浏览文件 @
28195baa
...
...
@@ -7,6 +7,7 @@
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
CMock_Init(); \
UNITY_CLR_DETAILS(); \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
...
...
test/expectdata/testsample_mock_new2.c
浏览文件 @
28195baa
...
...
@@ -7,6 +7,7 @@
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
CMock_Init(); \
UNITY_CLR_DETAILS(); \
if (TEST_PROTECT()) \
{ \
setUp(); \
...
...
test/expectdata/testsample_mock_param.c
浏览文件 @
28195baa
...
...
@@ -8,6 +8,7 @@
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
CMock_Init(); \
UNITY_CLR_DETAILS(); \
if (TEST_PROTECT()) \
{ \
setUp(); \
...
...
test/expectdata/testsample_mock_run1.c
浏览文件 @
28195baa
...
...
@@ -7,6 +7,7 @@
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
CMock_Init(); \
UNITY_CLR_DETAILS(); \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
...
...
test/expectdata/testsample_mock_run2.c
浏览文件 @
28195baa
...
...
@@ -7,6 +7,7 @@
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
CMock_Init(); \
UNITY_CLR_DETAILS(); \
if (TEST_PROTECT()) \
{ \
setUp(); \
...
...
test/expectdata/testsample_mock_yaml.c
浏览文件 @
28195baa
...
...
@@ -7,6 +7,7 @@
Unity.CurrentTestLineNumber = TestLineNum; \
Unity.NumberOfTests++; \
CMock_Init(); \
UNITY_CLR_DETAILS(); \
if (TEST_PROTECT()) \
{ \
CEXCEPTION_T e; \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录