Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
9fdcc2d3
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看板
提交
9fdcc2d3
编写于
10月 21, 2019
作者:
M
Mark VanderVoord
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Catch up documentation to match these changes.
上级
d9b0edf2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
38 deletion
+9
-38
docs/UnityConfigurationGuide.md
docs/UnityConfigurationGuide.md
+2
-32
docs/UnityGettingStartedGuide.md
docs/UnityGettingStartedGuide.md
+7
-6
未找到文件。
docs/UnityConfigurationGuide.md
浏览文件 @
9fdcc2d3
...
...
@@ -119,10 +119,10 @@ Define this to be the number of bits a pointer takes up on your system. The
default, if not autodetected, is 32-bits. If you're getting ugly compiler
warnings about casting from pointers, this is the one to look at.
_Hint:_
In order to support exotic processors (for example TI C55x with a pointer
_Hint:_
In order to support exotic processors (for example TI C55x with a pointer
width of 23-bit), choose the next power of two (in this case 32-bit).
_Supported values:_
16, 32 and 64
_Supported values:_
16, 32 and 64
_Example:_
```
C
...
...
@@ -343,36 +343,6 @@ _Note:_
specifying
`UNITY_USE_FLUSH_STDOUT`
. No other defines are required.
##### `UNITY_WEAK_ATTRIBUTE`
##### `UNITY_WEAK_PRAGMA`
##### `UNITY_NO_WEAK`
For some targets, Unity can make the otherwise required setUp() and tearDown()
functions optional. This is a nice convenience for test writers since setUp and
tearDown don’t often actually do anything. If you’re using gcc or clang, this
option is automatically defined for you. Other compilers can also support this
behavior, if they support a C feature called weak functions. A weak function is
a function that is compiled into your executable unless a non-weak version of
the same function is defined elsewhere. If a non-weak version is found, the weak
version is ignored as if it never existed. If your compiler supports this feature,
you can let Unity know by defining UNITY_WEAK_ATTRIBUTE or UNITY_WEAK_PRAGMA as
the function attributes that would need to be applied to identify a function as
weak. If your compiler lacks support for weak functions, you will always need to
define setUp and tearDown functions (though they can be and often will be just
empty). You can also force Unity to NOT use weak functions by defining
UNITY_NO_WEAK. The most common options for this feature are:
_Example:_
```
C
#define UNITY_WEAK_ATTRIBUTE weak
#define UNITY_WEAK_ATTRIBUTE __attribute__((weak))
#define UNITY_WEAK_PRAGMA
#define UNITY_NO_WEAK
```
##### `UNITY_PTR_ATTRIBUTE`
Some compilers require a custom attribute to be assigned to pointers, like
...
...
docs/UnityGettingStartedGuide.md
浏览文件 @
9fdcc2d3
...
...
@@ -93,8 +93,9 @@ Next, a test file will include a `setUp()` and `tearDown()` function. The setUp
function can contain anything you would like to run before each test. The
tearDown function can contain anything you would like to run after each test.
Both functions accept no arguments and return nothing. You may leave either or
both of these blank if you have no need for them. If you're using a compiler
that is configured to make these functions optional, you may leave them off
both of these blank if you have no need for them.
If you're using Ceedling or the test runner generator script, you may leave these off
completely. Not sure? Give it a try. If you compiler complains that it can't
find setUp or tearDown when it links, you'll know you need to at least include
an empty function for these.
...
...
@@ -103,7 +104,7 @@ The majority of the file will be a series of test functions. Test functions
follow the convention of starting with the word "test_" or "spec_". You don't HAVE
to name them this way, but it makes it clear what functions are tests for other
developers. Also, the automated scripts that come with Unity or Ceedling will default
to looking for test functions to be prefixed this way. Test functions take no arguments
to looking for test functions to be prefixed this way. Test functions take no arguments
and return nothing. All test accounting is handled internally in Unity.
Finally, at the bottom of your test file, you will write a
`main()`
function.
...
...
@@ -156,7 +157,7 @@ This should be enough to get you going, though.
### Running Test Functions
When writing your own
`main()`
functions, for a test-runner. There are two ways
to execute the test.
to execute the test.
The classic variant
```
c
...
...
@@ -170,8 +171,8 @@ These macros perform the necessary setup before the test is called and
handles cleanup and result tabulation afterwards.
### Ignoring Test Functions
There are times when a test is incomplete or not valid for some reason.
At these times, TEST_IGNORE can be called. Control will immediately be
There are times when a test is incomplete or not valid for some reason.
At these times, TEST_IGNORE can be called. Control will immediately be
returned to the caller of the test, and no failures will be returned.
This is useful when your test runners are automatically generated.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录