未验证 提交 fd40900a 编写于 作者: O openharmony_ci 提交者: Gitee

!2725 【轻量级 PR】:update zh-cn/readme/测试子系统.md.

Merge pull request !2725 from stivn/N/A
......@@ -75,20 +75,6 @@ subsystem # 子系统
- 用例示例
```
/*
* Copyright (c) 2021 XXXX Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "calculator.h"
#include <gtest/gtest.h>
......@@ -140,22 +126,9 @@ subsystem # 子系统
```
详细内容介绍:
1. 添加测试用例文件头注释信息
```
/*
* Copyright (c) 2021 XXXX Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
```
按照标准头注释信息格式填写,请查阅[编写规范](https://gitee.com/openharmony/docs/blob/master/zh-cn/contribute/%E8%B4%A1%E7%8C%AE%E4%BB%A3%E7%A0%81.md)。
2. 引用测试框架头文件和命名空间
```
#include <gtest/gtest.h>
......@@ -255,20 +228,6 @@ subsystem # 子系统
- 用例示例
```
/*
* Copyright (C) 2021 XXXX Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import app from '@system.app'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
......@@ -311,22 +270,9 @@ subsystem # 子系统
```
详细内容介绍:
1. 添加测试用例文件头注释信息
```
/*
* Copyright (C) 2021 XXXX Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
```
按照标准头注释信息格式填写,请查阅[编写规范](https://gitee.com/openharmony/docs/blob/master/zh-cn/contribute/%E8%B4%A1%E7%8C%AE%E4%BB%A3%E7%A0%81.md)。
2. 导入被测api和jsunit测试库
```
import app from '@system.app'
......@@ -381,7 +327,6 @@ subsystem # 子系统
- **C++用例编译配置示例**
```
# Copyright (c) 2021 XXXX Device Co., Ltd.
import("//build/test.gni")
......@@ -416,9 +361,9 @@ subsystem # 子系统
详细内容如下:
1. 添加文件头注释信息
```
# Copyright (c) 2021 XXXX Device Co., Ltd.
```
按照标准头注释信息格式填写,请查阅[编写规范](https://gitee.com/openharmony/docs/blob/master/zh-cn/contribute/%E8%B4%A1%E7%8C%AE%E4%BB%A3%E7%A0%81.md)。
2. 导入编译模板文件
```
import("//build/test.gni")
......@@ -483,7 +428,6 @@ subsystem # 子系统
- **JavaScript用例编译配置示例**
```
# Copyright (C) 2021 XXXX Device Co., Ltd.
import("//build/test.gni")
......@@ -505,10 +449,9 @@ subsystem # 子系统
详细内容如下:
1. 添加文件头注释信息
```
# Copyright (C) 2021 XXXX Device Co., Ltd.
```
按照标准头注释信息格式填写,请查阅[编写规范](https://gitee.com/openharmony/docs/blob/master/zh-cn/contribute/%E8%B4%A1%E7%8C%AE%E4%BB%A3%E7%A0%81.md)。
2. 导入编译模板文件
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册