Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
629b86d5
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看板
提交
629b86d5
编写于
11月 01, 2017
作者:
J
John Lindgren
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge unity_setup.h into unity.h.
上级
df78aade
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
42 deletion
+32
-42
auto/generate_test_runner.rb
auto/generate_test_runner.rb
+2
-2
src/unity.c
src/unity.c
+1
-1
src/unity.h
src/unity.h
+29
-6
src/unity_setup.h
src/unity_setup.h
+0
-33
未找到文件。
auto/generate_test_runner.rb
浏览文件 @
629b86d5
...
...
@@ -157,10 +157,10 @@ class UnityTestRunnerGenerator
output
.
puts
(
'/* AUTOGENERATED FILE. DO NOT EDIT. */'
)
create_runtest
(
output
,
mocks
)
output
.
puts
(
"
\n
/*=======Automagically Detected Files To Include=====*/"
)
output
.
puts
(
"#include
\"
#{
@options
[
:framework
]
}
.h
\"
"
)
output
.
puts
(
'#ifdef __WIN32__'
)
output
.
puts
(
"#include
\"
#{
@options
[
:framework
]
}
_setup.h
\"
"
)
output
.
puts
(
'#define UNITY_INCLUDE_SETUP_STUBS'
)
output
.
puts
(
'#endif'
)
output
.
puts
(
"#include
\"
#{
@options
[
:framework
]
}
.h
\"
"
)
output
.
puts
(
'#include "cmock.h"'
)
unless
mocks
.
empty?
output
.
puts
(
'#include <setjmp.h>'
)
output
.
puts
(
'#include <stdio.h>'
)
...
...
src/unity.c
浏览文件 @
629b86d5
...
...
@@ -4,8 +4,8 @@
[Released under MIT License. Please refer to license.txt for details]
============================================================================ */
#define UNITY_INCLUDE_SETUP_STUBS
#include "unity.h"
#include "unity_setup.h"
#include <stddef.h>
/* If omitted from header, declare overrideable prototypes here so they're ready for use */
...
...
src/unity.h
浏览文件 @
629b86d5
...
...
@@ -15,20 +15,43 @@ extern "C"
#include "unity_internals.h"
/* These functions are intended to be called before and after each test. Unity
* provides stub implementations annotated as weak symbols (if supported by the
* compiler). */
/*-------------------------------------------------------
* Test Setup / Teardown
*-------------------------------------------------------*/
/* These functions are intended to be called before and after each test. */
void
setUp
(
void
);
void
tearDown
(
void
);
/* These functions are intended to be called at the beginning and end of an
* entire test suite. suiteTearDown() is passed the number of tests that
* failed, and its return value becomes the exit code of main(). Unity
* provides stub implementations annotated as weak symbols (if supported by the
* compiler). */
* failed, and its return value becomes the exit code of main(). */
void
suiteSetUp
(
void
);
int
suiteTearDown
(
int
num_failures
);
/* If the compiler supports it, the following block provides stub
* implementations of the above functions as weak symbols. Note that on
* some platforms (MinGW for example), weak function implementations need
* to be in the same translation unit they are called from. This can be
* achieved by defining UNITY_INCLUDE_SETUP_STUBS before including unity.h. */
#ifdef UNITY_INCLUDE_SETUP_STUBS
#ifdef UNITY_WEAK_ATTRIBUTE
UNITY_WEAK_ATTRIBUTE
void
setUp
(
void
)
{
}
UNITY_WEAK_ATTRIBUTE
void
tearDown
(
void
)
{
}
UNITY_WEAK_ATTRIBUTE
void
suiteSetUp
(
void
)
{
}
UNITY_WEAK_ATTRIBUTE
int
suiteTearDown
(
int
num_failures
)
{
return
num_failures
;
}
#elif defined(UNITY_WEAK_PRAGMA)
#pragma weak setUp
void
setUp
(
void
)
{
}
#pragma weak tearDown
void
tearDown
(
void
)
{
}
#pragma weak suiteSetUp
void
suiteSetUp
(
void
)
{
}
#pragma weak suiteTearDown
int
suiteTearDown
(
int
num_failures
)
{
return
num_failures
;
}
#endif
#endif
/*-------------------------------------------------------
* Configuration Options
*-------------------------------------------------------
...
...
src/unity_setup.h
已删除
100644 → 0
浏览文件 @
df78aade
/* ==========================================
Unity Project - A Test Framework for C
Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams
[Released under MIT License. Please refer to license.txt for details]
========================================== */
#ifndef UNITY_SETUP_H
#define UNITY_SETUP_H
#include "unity_internals.h"
/* On some platforms (MinGW for example), weak function implementations
* need to be in the same translation unit they are called from. This
* header can be included to provide implementations of setUp(), tearDown(),
* suiteSetUp(), and suiteTearDown(). */
#if defined(UNITY_WEAK_ATTRIBUTE)
UNITY_WEAK_ATTRIBUTE
void
setUp
(
void
)
{
}
UNITY_WEAK_ATTRIBUTE
void
tearDown
(
void
)
{
}
UNITY_WEAK_ATTRIBUTE
void
suiteSetUp
(
void
)
{
}
UNITY_WEAK_ATTRIBUTE
int
suiteTearDown
(
int
num_failures
)
{
return
num_failures
;
}
#elif defined(UNITY_WEAK_PRAGMA)
#pragma weak setUp
void
setUp
(
void
)
{
}
#pragma weak tearDown
void
tearDown
(
void
)
{
}
#pragma weak suiteSetUp
void
suiteSetUp
(
void
)
{
}
#pragma weak suiteTearDown
int
suiteTearDown
(
int
num_failures
)
{
return
num_failures
;
}
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录