!5 文档修改

Merge pull request !5 from songdawei/master
This commit is contained in:
openharmony_sig_ci 2022-03-07 09:20:00 +00:00 committed by Gitee
commit 7a6f52aafb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 70 additions and 68 deletions

View File

@ -14,12 +14,12 @@
## Introduction<a name="section465982318513"></a>
The X test suite \(XTS\) subsystem contains a set of OpenHarmony certification test suites, including the currently supported hardware abstract test suite \(HATS\).
The X test suite \(XTS\) subsystem contains a set of OpenHarmony certification test suites, including the currently supported distributed compatibility test suite \(DCTS\).
This subsystem contains the HATS and **tools** software package.
This subsystem contains the DCTS and **tools** software package.
- The **hats** directory stores the source code and configuration files of HATS test cases. The HATS helps device vendors detect the HAL software incompatibility as early as possible and ensures that the software is compatible to OpenHarmony during the entire development process.
- The **tools** software package stores the test case development framework related to **hats**.
- The **dcts** directory stores the source code and configuration files of DCTS test cases. The DCTS helps device vendors detect the distributed scenario incompatibility as early as possible and ensures that the software is compatible to OpenHarmony during the entire development process.
- The **tools** software package stores the test case development framework related to **dcts**.
## System Types<a name="section125090457443"></a>
@ -42,9 +42,10 @@ OpenHarmony supports the following system types:
```
/test/xts
├── hats # Test code
├── dcts # Test code
│ └── subsystem # Source code of subsystem test cases for the standard system
│ └── subsystem_lite # Source code of subsystems test cases for mini and small systems
│ └── common # Source code of Test cases rely on shared memory for mini and small systems
│ └── BUILD.gn # Build configuration of test cases for the standard system
│ └── build_lite
│ └── BUILD.gn # Build configuration of test cases for mini and small systems
@ -253,10 +254,10 @@ You should select the appropriate programming language and your target test fram
The HCTest framework is used to support test cases developed with the C language. HCTest is enhanced and adapted based on the open-source test framework Unity.
1. Access the **test/xts/hats** repository where the test cases will be stored.
1. Access the **test/xts/dcts** repository where the test cases will be stored.
```
├── hats
├── dcts
│ └──subsystem_lite
│ │ └── module_hal
│ │ │ └── BUILD.gn
@ -314,8 +315,8 @@ The HCTest framework is used to support test cases developed with the C language
```
import("//test/xts/tools/lite/build/suite_lite.gni")
hctest_suite("HatsDemoTest") {
suite_name = "hats"
hctest_suite("DctsDemoTest") {
suite_name = "dcts"
sources = [
"src/test_demo.c",
]
@ -324,17 +325,17 @@ The HCTest framework is used to support test cases developed with the C language
}
```
4. Add build options to the **BUILD.gn** file in the **hats** directory.
4. Add build options to the **BUILD.gn** file in the **dcts** directory.
You need to add the test module to the **test/xts/hats/build\_lite/BUILD.gn** script in the **hats** directory.
You need to add the test module to the **test/xts/dcts/build\_lite/BUILD.gn** script in the **dcts** directory.
```
lite_component("hats") {
lite_component("dcts") {
...
if(board_name == "liteos_m") {
features += [
...
"//xts/hats/subsystem_lite/module_hal:HatsDemoTest"
"//xts/dcts/subsystem_lite/module_hal:DctsDemoTest"
]
}
}
@ -342,10 +343,10 @@ The HCTest framework is used to support test cases developed with the C language
5. Run build commands.
Test suites are built along with version build. The HATS is built together with the debug version.
Test suites are built along with version build. The DCTS is built together with the debug version.
>![](figures/icon-note.gif) **NOTE:**
>The HATS build middleware is a static library, which will be linked to the image.
>The DCTS build middleware is a static library, which will be linked to the image.
### C-based Test Case Execution \(for the Mini System\)<a name="section13820233175418"></a>
@ -371,10 +372,10 @@ The log for each test suite starts with **Start to run test suite:** and ends
The HCPPTest framework is enhanced and adapted based on the open-source framework Googletest.
1. Access the **test/xts/hats** repository where the test cases will be stored.
1. Access the **test/xts/dcts** repository where the test cases will be stored.
```
├── hats
├── dcts
│ └──subsystem_lite
│ │ └── module_posix
│ │ │ └── BUILD.gn
@ -439,8 +440,8 @@ The HCPPTest framework is enhanced and adapted based on the open-source framewor
```
import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("HatsDemoTest") {
suite_name = "hats"
hcpptest_suite("DctsDemoTest") {
suite_name = "dcts"
sources = [
"src/TestDemo.cpp"
]
@ -456,17 +457,17 @@ The HCPPTest framework is enhanced and adapted based on the open-source framewor
}
```
4. Add build options to the **BUILD.gn** file in the **hats** directory.
4. Add build options to the **BUILD.gn** file in the **dcts** directory.
Add the test module to the **test/xts/hats/build\_lite/BUILD.gn** script in the **hats** directory.
Add the test module to the **test/xts/dcts/build\_lite/BUILD.gn** script in the **dcts** directory.
```
lite_component("hats") {
lite_component("dcts") {
...
else if(board_name == "liteos_a") {
features += [
...
"//xts/hats/subsystem_lite/module_posix:HatsDemoTest"
"//xts/dcts/subsystem_lite/module_posix:DctsDemoTest"
]
}
}
@ -474,10 +475,10 @@ The HCPPTest framework is enhanced and adapted based on the open-source framewor
5. Run build commands.
Test suites are built along with the version build. The HATS is built together with the debug version.
Test suites are built along with the version build. The DCTS is built together with the debug version.
>![](figures/icon-note.gif) **NOTE:**
>The HATS for the small system is independently built to an executable file \(.bin\) and archived in the **suites\\hats** directory of the build result.
>The DCTS for the small system is independently built to an executable file \(.bin\) and archived in the **suites\\dcts** directory of the build result.
### C++-based Test Case Execution \(for Standard and Small Systems\)<a name="section128222336544"></a>
@ -504,4 +505,4 @@ Currently, test cases are shared by the NFS and mounted to the development board
**Executing test cases**
Execute **HatsDemoTest.bin** to trigger test case execution, and analyze serial port logs generated after the execution is complete.
Execute **DctsDemoTest.bin** to trigger test case execution, and analyze serial port logs generated after the execution is complete.

View File

@ -15,12 +15,12 @@
## 简介<a name="section465982318513"></a>
XTS子系统是OpenHarmony生态认证测试套件的集合当前包括hatshardware abstract test suiteHAL兼容性测试套件。
XTS子系统是OpenHarmony生态认证测试套件的集合当前包括dctsdistributed compatibility test suite分布式兼容性测试套件。
XTS子系统当前包括hats与tools软件包
XTS子系统当前包括dcts与tools软件包
- hats存放hats相关测试用例源码与配置文件其目的是帮助终端设备厂商尽早发现HAL层软件与OpenHarmony的不兼容性确保软件在整个开发过程中满足OpenHarmony的兼容性要求。
- tools存放hats相关测试用例开发框架。
- dcts存放dcts相关测试用例源码与配置文件其目的是帮助终端设备厂商尽早发现在分布式场景下与OpenHarmony的不兼容性确保软件在整个开发过程中满足OpenHarmony的兼容性要求。
- tools存放dcts相关测试用例开发框架。
## 系统类型<a name="section125090457443"></a>
@ -43,9 +43,10 @@ OpenHarmony支持如下几种系统类型
```
/test/xts
├── hats # 测试代码存放目录
├── dcts # 测试代码存放目录
│ └── subsystem # 标准系统子系统测试用例源码存放目录
│ └── subsystem_lite # 轻量系统、小型系统子系统测试用例源码存放目录
│ └── common # 测试用例依赖共享内存源码存放目录
│ └── BUILD.gn # 标准系统测试用例编译配置
│ └── build_lite # 轻量系统、小型系统测试用例编译配置存放目录
│ └── BUILD.gn # 轻量系统、小型系统测试用例编译配置
@ -254,10 +255,10 @@ OpenHarmony支持如下几种系统类型
当前使用的测试框架是hctesthctest测试框架支持使用C语言编写测试用例是在开源测试框架unity的基础上进行增强和适配。
1. 用例目录规范测试用例存储到test/xts/hats仓中
1. 用例目录规范测试用例存储到test/xts/dcts仓中
```
├── hats
├── dcts
│ └──subsystem_lite
│ │ └── module_hal
│ │ │ └── BUILD.gn
@ -315,8 +316,8 @@ OpenHarmony支持如下几种系统类型
```
import("//test/xts/tools/lite/build/suite_lite.gni")
hctest_suite("HatsDemoTest") {
suite_name = "hats"
hctest_suite("DctsDemoTest") {
suite_name = "dcts"
sources = [
"src/test_demo.c",
]
@ -325,17 +326,17 @@ OpenHarmony支持如下几种系统类型
}
```
4. hats下BUILD.gn增加编译选项。
4. dcts下BUILD.gn增加编译选项。
需要将测试模块加入到hats目录下的编译脚本中编译脚本路径test/xts/hats/build\_lite/BUILD.gn。
需要将测试模块加入到dcts目录下的编译脚本中编译脚本路径test/xts/dcts/build\_lite/BUILD.gn。
```
lite_component("hats") {
lite_component("dcts") {
...
if(board_name == "liteos_m") {
features += [
...
"//xts/hats/subsystem_lite/module_hal:HatsDemoTest"
"//xts/dcts/subsystem_lite/module_hal:DctsDemoTest"
]
}
}
@ -343,10 +344,10 @@ OpenHarmony支持如下几种系统类型
5. 测试套件编译命令。
随版本编译debug版本编译时会同步编译hats测试套件
随版本编译debug版本编译时会同步编译dcts测试套件
>![](figures/icon-note.gif) **说明:**
>hats测试套件编译中间件为静态库最终链接到版本镜像中 。
>dcts测试套件编译中间件为静态库最终链接到版本镜像中 。
### C语言用例执行指导适用于轻量系统产品用例开发<a name="section13820233175418"></a>
@ -372,10 +373,10 @@ OpenHarmony支持如下几种系统类型
当前使用的测试框架是hcpptesthcpptest测试框架是在开源的googletest测试框架的基础上进行的增强和适配。
1. 规范用例目录测试用例存储到test/xts/hats仓中。
1. 规范用例目录测试用例存储到test/xts/dcts仓中。
```
├── hats
├── dcts
│ └──subsystem_lite
│ │ └── module_posix
│ │ │ └── BUILD.gn
@ -440,8 +441,8 @@ OpenHarmony支持如下几种系统类型
```
import("//test/xts/tools/lite/build/suite_lite.gni")
hcpptest_suite("HatsDemoTest") {
suite_name = "hats"
hcpptest_suite("DctsDemoTest") {
suite_name = "dcts"
sources = [
"src/TestDemo.cpp"
]
@ -458,17 +459,17 @@ OpenHarmony支持如下几种系统类型
```
4. hats目录下增加编译选项BUILD.gn样例
4. dcts目录下增加编译选项BUILD.gn样例
将测试模块加入到hats目录下的编译脚本中编译脚本为test/xts/hats/build\_lite/BUILD.gn。
将测试模块加入到dcts目录下的编译脚本中编译脚本为test/xts/dcts/build\_lite/BUILD.gn。
```
lite_component("hats") {
lite_component("dcts") {
...
else if(board_name == "liteos_a") {
features += [
...
"//xts/hats/subsystem_lite/module_posix:HatsDemoTest"
"//xts/dcts/subsystem_lite/module_posix:DctsDemoTest"
]
}
}
@ -476,10 +477,10 @@ OpenHarmony支持如下几种系统类型
5. 测试套件编译命令。
随版本编译debug版本编译时会同步编译hats测试套件
随版本编译debug版本编译时会同步编译dcts测试套件
>![](figures/icon-note.gif) **说明:**
>小型系统hats独立编译成可执行文件bin格式 在编译产物的suites\\hats目录下归档。
>小型系统dcts独立编译成可执行文件bin格式 在编译产物的suites\\dcts目录下归档。
### C++语言用例执行指导(适用于小型系统、标准系统用例开发)<a name="section128222336544"></a>
@ -506,21 +507,21 @@ OpenHarmony支持如下几种系统类型
**用例执行**
测试套件执行 HatsDemoTest.bin 触发用例执行,基于串口打印日志进行分析。
测试套件执行 DctsDemoTest.bin 触发用例执行,基于串口打印日志进行分析。
### 全量编译指导(适用于标准系统)<a name="section128222336544"></a>
全量编译test/xts/hats目录下执行编译命令: ./build.sh suite=hats system_size=standard
全量编译test/xts/dcts目录下执行编译命令: ./build.sh suite=dcts system_size=standard
测试用例输出目录out/release/suites/hats/testcases
测试用例输出目录out/release/suites/dcts/testcases
测试框架&用例整体输出目录out/release/suites/hats(编译用例时会同步编译测试套执行框架)
测试框架&用例整体输出目录out/release/suites/dcts(编译用例时会同步编译测试套执行框架)
### 全量用例执行指导(适用于小型系统、标准系统)<a name="section128222336544"></a>
搭建测试环境 Windows工作台下安装python3.7及以上版本,确保工作台和测试设备正常连接。
测试执行目录对应编译生成的out/release/suites/hats目录
测试执行目录对应编译生成的out/release/suites/dcts目录
```
├── testcase # 测试套文件存放目录
@ -533,20 +534,20 @@ OpenHarmony支持如下几种系统类型
```
用例执行
在Windows工作台上找到从Linux服务器上拷贝下来的测试套件用例目录在Windows命令窗口进入对应目录直接执行hats\run.bat。
在Windows工作台上找到从Linux服务器上拷贝下来的测试套件用例目录在Windows命令窗口进入对应目录直接执行dcts\run.bat。
界面启动后,输入用例执行指令。
全量执行run hats
全量执行run dcts
模块执行(具体模块可以查看\hats\testcases)run l ActsSamgrTest
模块执行(具体模块可以查看\dcts\testcases)run l DctsSamgrTest
查看测试报告。 进入hats\reports\获取当前的执行记录打开“summary_report.html”可以获取到测试报告。
查看测试报告。 进入dcts\reports\获取当前的执行记录打开“summary_report.html”可以获取到测试报告。
## 相关仓<a name="section1371113476307"></a>
xts\_hats
xts\_dcts
xts\_tools

View File

@ -18,18 +18,18 @@ _all_test_packages = [ "${DCTS_ROOT}/distributeddatamgr:distributeddatatest",
]
_all_test_packages_ivi = [
# add hats for ivi here
# "${HATS_ROOT}/multimedia:multimedia_ivi",
# add dcts for ivi here
# "${DCTS_ROOT}/multimedia:multimedia_ivi",
]
_all_test_packages_intellitv = [
# add hats for intellitv here
#"${HATS_ROOT}/multimedia:multimedia_intellitv",
# add dcts for intellitv here
#"${DCTS_ROOT}/multimedia:multimedia_intellitv",
]
_all_test_packages_wearable = [
# add hats for wearable here
#"${HATS_ROOT}/multimedia:multimedia_wearable",
# add dcts for wearable here
#"${DCTS_ROOT}/multimedia:multimedia_wearable",
]
selected_packages_wearable = []
@ -77,5 +77,5 @@ if (build_xts == true && XTS_SUITENAME == "dcts") {
selected_packages_intellitv += [ "testtools:deploy_testtools" ]
selected_packages_wearable += [ "testtools:deploy_testtools" ]
} else {
print("HATS build is not enabled")
print("DCTS build is not enabled")
}