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

!9981 【翻译完成】#I5P4NX (代码格式修改)

Merge pull request !9981 from Annie_wang/PR8193
...@@ -4,7 +4,7 @@ OpenHarmony provides a comprehensive auto-test framework for designing test case ...@@ -4,7 +4,7 @@ OpenHarmony provides a comprehensive auto-test framework for designing test case
This document describes how to use the OpenHarmony test framework. This document describes how to use the OpenHarmony test framework.
## Setting Up the Environment ## Setting Up the Environment
The test framework depends on the Python running environment. Before using the test framework, set up the environment as follows: The test framework depends on the Python running environment. Before using the test framework, set up the environment as follows:
- [Setting Up the Environment](../device-dev/subsystems/subsys-testguide-envbuild.md) - [Setting Up the Environment](../device-dev/subsystems/subsys-testguide-test.md#setting-up-the-environment)
- [Obtaining Source Code](../device-dev/get-code/sourcecode-acquire.md) - [Obtaining Source Code](../device-dev/get-code/sourcecode-acquire.md)
...@@ -12,48 +12,48 @@ The test framework depends on the Python running environment. Before using the t ...@@ -12,48 +12,48 @@ The test framework depends on the Python running environment. Before using the t
The directory structure of the test framework is as follows: The directory structure of the test framework is as follows:
``` ```
test # Test subsystem test # Test subsystem
├── developertest # Developer test module ├── developertest # Developer test module
│ ├── aw # Static library of the test framework │ ├── aw # Static library of the test framework
│ ├── config # Test framework configuration │ ├── config # Test framework configuration
│ │ │ ... │ │ │ ...
│ │ └── user_config.xml # User configuration │ │ └── user_config.xml # User configuration
│ ├── examples # Examples of test cases │ ├── examples # Examples of test cases
│ ├── src # Source code of the test framework │ ├── src # Source code of the test framework
│ ├── third_party # Adaptation code for third-party components on which the test framework depends │ ├── third_party # Adaptation code for third-party components on which the test framework depends
│ ├── reports # Test reports │ ├── reports # Test reports
│ ├── BUILD.gn # Build entry of the test framework │ ├── BUILD.gn # Build entry of the test framework
│ ├── start.bat # Test entry for Windows │ ├── start.bat # Test entry for Windows
│ └── start.sh # Test entry for Linux │ └── start.sh # Test entry for Linux
└── xdevice # Modules on which the test framework depends └── xdevice # Modules on which the test framework depends
``` ```
## Writing Test Cases ## Writing Test Cases
### Designing the Test Case Directory ### Designing the Test Case Directory
Design the test case directory as follows: Design the test case directory as follows:
``` ```
subsystem # Subsystem subsystem # Subsystem
├── partA # Part A ├── partA # Part A
│ ├── moduleA # Module A │ ├── moduleA # Module A
│ │ ├── include │ │ ├── include
│ │ ├── src # Service code │ │ ├── src # Service code
│ │ └── test # Test directory │ │ └── test # Test directory
│ │ ├── unittest # Unit test │ │ ├── unittest # Unit test
│ │ │ ├── common # Common test cases │ │ │ ├── common # Common test cases
│ │ │ │ ├── BUILD.gn # Build file of test cases │ │ │ │ ├── BUILD.gn # Build file of test cases
│ │ │ │ └── testA_test.cpp # Source code of unit test cases │ │ │ │ └── testA_test.cpp # Source code of unit test cases
│ │ │ ├── phone # Test cases for mobile phones │ │ │ ├── phone # Test cases for mobile phones
│ │ │ ├── ivi # Test cases for head units │ │ │ ├── ivi # Test cases for head units
│ │ │ └── liteos-a # Test cases for the IP cameras that use the LiteOS kernel │ │ │ └── liteos-a # Test cases for the IP cameras that use the LiteOS kernel
│ │ ├── moduletest # Module test │ │ ├── moduletest # Module test
│ │ ... │ │ ...
│ │ │ │
│ ├── moduleB # Module B │ ├── moduleB # Module B
│ ├── test │ ├── test
│ │ └── resource # Dependency resources │ │ └── resource # Dependency resources
│ │ ├── moduleA # Module A │ │ ├── moduleA # Module A
│ │ │ ├── ohos_test.xml # Resource configuration file │ │ │ ├── ohos_test.xml # Resource configuration file
│ │ ... └── 1.txt # Resource file │ │ ... └── 1.txt # Resource file
│ │ │ │
│ ├── ohos_build # Build entry configuration │ ├── ohos_build # Build entry configuration
│ ... │ ...
... ...
...@@ -213,7 +213,7 @@ Example: ...@@ -213,7 +213,7 @@ Example:
|Performance test |PERF| |Performance test |PERF|
|Reliability test |RELI| |Reliability test |RELI|
|Security test |SECU| |Security test |SECU|
|Fuzz test |FUZZ| |Fuzz test |FUZZ|
#### JavaScript Test Case Example #### JavaScript Test Case Example
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册