Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
1cf02f8b
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看板
提交
1cf02f8b
编写于
5月 21, 2014
作者:
M
Mark VanderVoord
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support cmock's need to destroy all of its memory at the end of the suite
上级
124bfd80
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
16 addition
and
7 deletion
+16
-7
auto/generate_test_runner.rb
auto/generate_test_runner.rb
+8
-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_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
浏览文件 @
1cf02f8b
...
...
@@ -62,7 +62,7 @@ class UnityTestRunnerGenerator
create_mock_management
(
output
,
used_mocks
)
create_suite_setup_and_teardown
(
output
)
create_reset
(
output
,
used_mocks
)
create_main
(
output
,
input_file
,
tests
)
create_main
(
output
,
input_file
,
tests
,
used_mocks
)
end
end
...
...
@@ -142,11 +142,11 @@ class UnityTestRunnerGenerator
output
.
puts
(
'#include <setjmp.h>'
)
output
.
puts
(
'#include <stdio.h>'
)
output
.
puts
(
'#include "CException.h"'
)
if
@options
[
:plugins
].
include?
(
:cexception
)
testfile_includes
.
delete
(
"unity"
).
delete
(
"cmock"
)
testrunner_includes
=
testfile_includes
-
mocks
testrunner_includes
.
each
do
|
inc
|
output
.
puts
(
"#include
#{
inc
.
include?
(
'<'
)
?
inc
:
"
\"
#{
inc
.
gsub
(
'.h'
,
''
)
}
.h
\"
"
}
"
)
end
testfile_includes
.
delete
(
"unity"
).
delete
(
"cmock"
)
testrunner_includes
=
testfile_includes
-
mocks
testrunner_includes
.
each
do
|
inc
|
output
.
puts
(
"#include
#{
inc
.
include?
(
'<'
)
?
inc
:
"
\"
#{
inc
.
gsub
(
'.h'
,
''
)
}
.h
\"
"
}
"
)
end
mocks
.
each
do
|
mock
|
output
.
puts
(
"#include
\"
#{
mock
.
gsub
(
'.h'
,
''
)
}
.h
\"
"
)
end
...
...
@@ -261,7 +261,7 @@ class UnityTestRunnerGenerator
output
.
puts
(
"}"
)
end
def
create_main
(
output
,
filename
,
tests
)
def
create_main
(
output
,
filename
,
tests
,
used_mocks
)
output
.
puts
(
"
\n\n
//=======MAIN====="
)
output
.
puts
(
"int main(void)"
)
output
.
puts
(
"{"
)
...
...
@@ -280,6 +280,7 @@ class UnityTestRunnerGenerator
tests
.
each
{
|
test
|
output
.
puts
(
" RUN_TEST(
#{
test
[
:test
]
}
,
#{
test
[
:line_number
]
}
);"
)
}
end
output
.
puts
()
output
.
puts
(
" CMock_Guts_MemFreeFinal();"
)
unless
used_mocks
.
empty?
output
.
puts
(
" return
#{
@options
[
:suite_teardown
].
nil?
?
""
:
"suite_teardown"
}
(UnityEnd());"
)
output
.
puts
(
"}"
)
end
...
...
test/expectdata/testsample_mock_cmd.c
浏览文件 @
1cf02f8b
...
...
@@ -74,5 +74,6 @@ int main(void)
RUN_TEST
(
test_TheFirstThingToTest
,
21
);
RUN_TEST
(
test_TheSecondThingToTest
,
43
);
CMock_Guts_MemFreeFinal
();
return
(
UnityEnd
());
}
test/expectdata/testsample_mock_def.c
浏览文件 @
1cf02f8b
...
...
@@ -70,5 +70,6 @@ int main(void)
RUN_TEST
(
test_TheFirstThingToTest
,
21
);
RUN_TEST
(
test_TheSecondThingToTest
,
43
);
CMock_Guts_MemFreeFinal
();
return
(
UnityEnd
());
}
test/expectdata/testsample_mock_new1.c
浏览文件 @
1cf02f8b
...
...
@@ -83,5 +83,6 @@ int main(void)
RUN_TEST
(
test_TheFirstThingToTest
,
21
);
RUN_TEST
(
test_TheSecondThingToTest
,
43
);
CMock_Guts_MemFreeFinal
();
return
(
UnityEnd
());
}
test/expectdata/testsample_mock_new2.c
浏览文件 @
1cf02f8b
...
...
@@ -83,5 +83,6 @@ int main(void)
RUN_TEST
(
test_TheFirstThingToTest
,
21
);
RUN_TEST
(
test_TheSecondThingToTest
,
43
);
CMock_Guts_MemFreeFinal
();
return
suite_teardown
(
UnityEnd
());
}
test/expectdata/testsample_mock_param.c
浏览文件 @
1cf02f8b
...
...
@@ -71,5 +71,6 @@ int main(void)
RUN_TEST
(
test_TheFirstThingToTest
,
21
,
RUN_TEST_NO_ARGS
);
RUN_TEST
(
test_TheSecondThingToTest
,
43
,
RUN_TEST_NO_ARGS
);
CMock_Guts_MemFreeFinal
();
return
(
UnityEnd
());
}
test/expectdata/testsample_mock_run1.c
浏览文件 @
1cf02f8b
...
...
@@ -83,5 +83,6 @@ int main(void)
RUN_TEST
(
test_TheFirstThingToTest
,
21
);
RUN_TEST
(
test_TheSecondThingToTest
,
43
);
CMock_Guts_MemFreeFinal
();
return
(
UnityEnd
());
}
test/expectdata/testsample_mock_run2.c
浏览文件 @
1cf02f8b
...
...
@@ -83,5 +83,6 @@ int main(void)
RUN_TEST
(
test_TheFirstThingToTest
,
21
);
RUN_TEST
(
test_TheSecondThingToTest
,
43
);
CMock_Guts_MemFreeFinal
();
return
suite_teardown
(
UnityEnd
());
}
test/expectdata/testsample_mock_yaml.c
浏览文件 @
1cf02f8b
...
...
@@ -84,5 +84,6 @@ int main(void)
RUN_TEST
(
test_TheFirstThingToTest
,
21
);
RUN_TEST
(
test_TheSecondThingToTest
,
43
);
CMock_Guts_MemFreeFinal
();
return
(
UnityEnd
());
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录