1# Testing<a name="EN-US_TOPIC_0000001075761006"></a> 2 3- [Overview](#section12403172115920) 4 - [Basic Concepts](#section53632272090) 5 - [Working Principles](#section2394431106) 6 7- [Limitations and Constraints](#section2029921310472) 8- [Setting Up a Test Environment](#section175012297491) 9 - [Environment Requirements](#section935055691014) 10 - [Installing the Environment](#section6511193210111) 11 - [Verifying the Test Environment](#section1899144517117) 12 13- [Development Guidelines](#section16741101301210) 14 - [When to Use](#section93782214124) 15 - [Available APIs](#section54131732101218) 16 - [How to Develop](#section53541946111218) 17 18- [Development Example](#section7477121918136) 19- [How to Use the Test Platform](#section76401945124810) 20- [Directory Structure](#section1875515364133) 21 22## Overview<a name="section12403172115920"></a> 23 24### Basic Concepts<a name="section53632272090"></a> 25 26The testing subsystem provides a one-click Python-based self-test platform for developers. It supports cross-platform tests and extension to third-party testing frameworks. The subsystem consists of modules for compiling, managing, scheduling and distributing, and executing test cases, collecting test results, generating test reports, creating test case templates, managing test environments, and many others. 27 28Before development using the testing subsystem, you need to understand the following concepts: 29 30- Test case compilation 31 32 This operation compiles the source code of test cases into binary files that can be executed on the tested device. 33 34- Test case scheduling & distributing 35 36 This operation distributes test cases to different tested devices through the network port or serial port, and allocates a specific executor for each test case. 37 38- Test case executor 39 40 A test case executor defines the execution logic of each test case, such as its pre-processing, execution, and result recording. 41 42- Test case template 43 44 A test case template defines respective unified formats for test cases and for GN files. 45 46- Test platform kits 47 48 The test platform provides common methods to be used during the running of the test tool, for example, providing the test case directory to mount the file system to a tested device, distributing test cases to the tested device, or obtaining test results from the tested device. 49 50- Test report generation 51 52 This operation defines a template for generating self-test reports and web test reports. 53 54- Test environment management 55 56 The tested devices can be managed through the USB port or serial port, including discovering a device and querying the device status. 57 58 59### Working Principles<a name="section2394431106"></a> 60 61- The following figure shows the architecture of the test platform. 62 63**Figure 1** Platform architecture<a name="fig418674910399"></a> 64 65 66- The following figure shows the running sequence diagram of the test platform. 67 68**Figure 2** Running sequence of the test platform<a name="fig107203017407"></a> 69 70 71- Working principle of the test platform 72 73The test platform is started using a shell script. It executes a series of testing commands entered on the command line interface \(CLI\) and prints the command output. 74 75## Limitations and Constraints<a name="section2029921310472"></a> 76 77- The self-test platform supports only code-level test case development and verification, such as unit testing and module testing. 78- Currently, the testing framework supports only white-box testing. 79- Only one test platform can be started on a testing device. 80 81## Setting Up a Test Environment<a name="section175012297491"></a> 82 83### Environment Requirements<a name="section935055691014"></a> 84 85**Table 1** Environment requirements 86 87<a name="table13112443615"></a> 88<table><thead align="left"><tr id="row1947247360"><th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.1"><p id="p64172414367"><a name="p64172414367"></a><a name="p64172414367"></a>Item</p> 89</th> 90<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.2"><p id="p6452410368"><a name="p6452410368"></a><a name="p6452410368"></a>Testing Device</p> 91</th> 92<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.3"><p id="p94924103617"><a name="p94924103617"></a><a name="p94924103617"></a>Tested Device</p> 93</th> 94</tr> 95</thead> 96<tbody><tr id="row10452414368"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p1422414368"><a name="p1422414368"></a><a name="p1422414368"></a>Hardware</p> 97</td> 98<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><a name="ul19802171518438"></a><a name="ul19802171518438"></a><ul id="ul19802171518438"><li>Memory: 8 GB or above</li><li>Hard disk space: 100 GB or above</li><li>Hardware architecture: x86 or ARM64</li></ul> 99</td> 100<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><a name="ul56772753313"></a><a name="ul56772753313"></a><ul id="ul56772753313"><li>Hi3516D V300 development board</li><li>Hi3518E V300 development board</li></ul> 101</td> 102</tr> 103<tr id="row24182410361"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p45102453620"><a name="p45102453620"></a><a name="p45102453620"></a>Software</p> 104</td> 105<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><a name="ul16677122216594"></a><a name="ul16677122216594"></a><ul id="ul16677122216594"><li>OS: Windows 10 (64-bit) or Ubuntu 18.04<p id="p717443952718"><a name="p717443952718"></a><a name="p717443952718"></a>System component (Linux): libreadline-dev</p> 106</li><li>Python: 3.7.5 or later</li><li>Python plug-ins: pySerial 3.3 or later, Paramiko 2.7.1 or later, Setuptools 40.8.0 or later, and RSA 4.0 or later</li><li>NFS server: haneWIN NFS Server 1.2.50 or later, or NFSv4 or later</li></ul> 107</td> 108<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><a name="ul20976824133414"></a><a name="ul20976824133414"></a><ul id="ul20976824133414"><li>OS: OpenHarmony 1.0 or later</li><li>Kernel: LiteOS Cortex-A or Linux kernel</li></ul> 109</td> 110</tr> 111</tbody> 112</table> 113 114### Installing the Environment<a name="section6511193210111"></a> 115 1161. \(Optional\) If the test environment runs Linux, run the following command to install system component Readline: 117 118 ``` 119 sudo apt-get install libreadline-dev 120 ``` 121 122 If the installation is successful, the following prompts are displayed: 123 124 ``` 125 Reading package lists... Done 126 Building dependency tree 127 Reading state information... Done 128 libreadline-dev is already the newest version (7.0-3). 129 0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded. 130 ``` 131 1322. Install Python extension plug-ins Setuptools. Install RSA, Paramiko, and pySerial if the device supports the serial port only. 133 134 1. Run the following command to install Setuptools: 135 136 ``` 137 pip install setuptools 138 ``` 139 140 If the installation is successful, the following prompts are displayed: 141 142 ``` 143 Requirement already satisfied: setuptools in d:\programs\python37\lib\site-packages (41.2.0) 144 ``` 145 146 2. Run the following command to install RSA: 147 148 ``` 149 pip install rsa 150 ``` 151 152 If the installation is successful, the following prompts are displayed: 153 154 ``` 155 Installing collected packages: pyasn1, rsa 156 Successfully installed pyasn1-0.4.8 rsa-4.7 157 ``` 158 159 3. Run the following command to install Paramiko: 160 161 ``` 162 pip install paramiko 163 ``` 164 165 If the installation is successful, the following prompts are displayed: 166 167 ``` 168 Installing collected packages: pycparser, cffi, pynacl, bcrypt, cryptography, paramiko 169 Successfully installed bcrypt-3.2.0 cffi-1.14.4 cryptography-3.3.1 paramiko-2.7.2 pycparser-2.20 pynacl-1.4.0 170 ``` 171 172 4. \(Optional\) Run the following command to install pySerial. This step is mandatory for tested devices that support serial ports only. 173 174 ``` 175 pip install pyserial 176 ``` 177 178 If the installation is successful, the following prompts are displayed: 179 180 ``` 181 Requirement already satisfied: pyserial in d:\programs\python37\lib\site-packages\pyserial-3.4-py3.7.egg (3.4) 182 ``` 183 1843. \(Optional\) Install the NFS server. This step is mandatory for tested devices that support serial ports only. 185 186 **Windows OS** 187 188 Download and install **haneWIN NFS Server 1.2.50** at https://www.hanewin.net/nfs-e.htm. 189 190 **Linux OS** 191 192 ``` 193 sudo apt install nfs-kernel-server 194 ``` 195 196 After the environment is installed, you can conduct coding and debugging for a test platform in an integrated development environment \(IDE\) \(DevEco Studio is recommended\). 197 198 199### Verifying the Test Environment<a name="section1899144517117"></a> 200 201**Table 2** Environment verification 202 203<a name="table76761616112218"></a> 204<table><thead align="left"><tr id="row6677121616229"><th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.1"><p id="p176771416182216"><a name="p176771416182216"></a><a name="p176771416182216"></a>Item</p> 205</th> 206<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.2"><p id="p18677181612220"><a name="p18677181612220"></a><a name="p18677181612220"></a>Operation</p> 207</th> 208<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.2.4.1.3"><p id="p5677151642215"><a name="p5677151642215"></a><a name="p5677151642215"></a>Requirement</p> 209</th> 210</tr> 211</thead> 212<tbody><tr id="row567731662216"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p1667711613224"><a name="p1667711613224"></a><a name="p1667711613224"></a>Check that a compliant Python version has been installed.</p> 213</td> 214<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p16678101614220"><a name="p16678101614220"></a><a name="p16678101614220"></a>Run the <strong id="b7670932632"><a name="b7670932632"></a><a name="b7670932632"></a>python --version</strong> command.</p> 215</td> 216<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p6554216134112"><a name="p6554216134112"></a><a name="p6554216134112"></a>The Python version must be 3.7.5 or later.</p> 217</td> 218</tr> 219<tr id="row559954144717"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p1259195419474"><a name="p1259195419474"></a><a name="p1259195419474"></a>Check that Python extension plug-ins have been installed.</p> 220</td> 221<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p175925424714"><a name="p175925424714"></a><a name="p175925424714"></a>Access the <strong id="b35031935731"><a name="b35031935731"></a><a name="b35031935731"></a>test/xdevice</strong> directory and run <strong id="b155070352317"><a name="b155070352317"></a><a name="b155070352317"></a>run.bat</strong> or <strong id="b5507935931"><a name="b5507935931"></a><a name="b5507935931"></a>run.sh</strong>.</p> 222</td> 223<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p1040211281418"><a name="p1040211281418"></a><a name="p1040211281418"></a>The <strong id="b82085361632"><a name="b82085361632"></a><a name="b82085361632"></a>>>></strong> prompt is displayed.</p> 224</td> 225</tr> 226<tr id="row66781016182213"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.1 "><p id="p8678416132217"><a name="p8678416132217"></a><a name="p8678416132217"></a>Check that the NFS server has been started (for tested devices that support serial ports only).</p> 227</td> 228<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.2 "><p id="p56781416142210"><a name="p56781416142210"></a><a name="p56781416142210"></a>Log in to the development board through the serial port and run the <strong id="b194410371631"><a name="b194410371631"></a><a name="b194410371631"></a>mount</strong> command to mount the NFS server.</p> 229</td> 230<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.2.4.1.3 "><p id="p27475710414"><a name="p27475710414"></a><a name="p27475710414"></a>The file directory can be mounted properly.</p> 231</td> 232</tr> 233</tbody> 234</table> 235 236## Development Guidelines<a name="section16741101301210"></a> 237 238### When to Use<a name="section93782214124"></a> 239 240You can call the APIs to conduct white box tests of service code. 241 242### Available APIs<a name="section54131732101218"></a> 243 244The testing framework integrates the open-source unit testing framework and expands the macros of the test cases. For details about the framework, see the official open-source documentation. 245 246**Table 3** Expanded macros of the framework 247 248<a name="table3247152012146"></a> 249<table><thead align="left"><tr id="row824713209143"><th class="cellrowborder" valign="top" width="11.41%" id="mcps1.2.3.1.1"><p id="p52484202141"><a name="p52484202141"></a><a name="p52484202141"></a>Macro</p> 250</th> 251<th class="cellrowborder" valign="top" width="88.59%" id="mcps1.2.3.1.2"><p id="p1424812015145"><a name="p1424812015145"></a><a name="p1424812015145"></a>Description</p> 252</th> 253</tr> 254</thead> 255<tbody><tr id="row424892018145"><td class="cellrowborder" valign="top" width="11.41%" headers="mcps1.2.3.1.1 "><p id="p5248192016144"><a name="p5248192016144"></a><a name="p5248192016144"></a>HWTEST</p> 256</td> 257<td class="cellrowborder" valign="top" width="88.59%" headers="mcps1.2.3.1.2 "><p id="p2248120191418"><a name="p2248120191418"></a><a name="p2248120191418"></a>The execution of test cases does not rely on setup and teardown execution. Based on the <strong id="b112735719267"><a name="b112735719267"></a><a name="b112735719267"></a>TEST</strong> macro, this macro has added the <strong id="b443291902514"><a name="b443291902514"></a><a name="b443291902514"></a>TestSize.Level1</strong> parameter to specify the test case level, for example, <strong id="b154975135291"><a name="b154975135291"></a><a name="b154975135291"></a>HWTEST(CalculatorAddTest, TestPoint_001, TestSize.Level1)</strong>.</p> 258</td> 259</tr> 260<tr id="row18248220131414"><td class="cellrowborder" valign="top" width="11.41%" headers="mcps1.2.3.1.1 "><p id="p4248132014144"><a name="p4248132014144"></a><a name="p4248132014144"></a>HWTEST_F</p> 261</td> 262<td class="cellrowborder" valign="top" width="88.59%" headers="mcps1.2.3.1.2 "><p id="p17248132061412"><a name="p17248132061412"></a><a name="p17248132061412"></a>The execution of test cases (without parameters) depends on setup and teardown execution. Based on the <strong id="b112055810312"><a name="b112055810312"></a><a name="b112055810312"></a>TEST_F</strong> macro, this macro has added the <strong id="b421113883115"><a name="b421113883115"></a><a name="b421113883115"></a>TestSize.Level1</strong> parameter to specify the test case level, for example, <strong id="b921114813118"><a name="b921114813118"></a><a name="b921114813118"></a>HWTEST_F(CalculatorAddTest, TestPoint_001, TestSize.Level1)</strong>.</p> 263</td> 264</tr> 265<tr id="row924892011148"><td class="cellrowborder" valign="top" width="11.41%" headers="mcps1.2.3.1.1 "><p id="p5248132031420"><a name="p5248132031420"></a><a name="p5248132031420"></a>HWTEST_P</p> 266</td> 267<td class="cellrowborder" valign="top" width="88.59%" headers="mcps1.2.3.1.2 "><p id="p1248142031417"><a name="p1248142031417"></a><a name="p1248142031417"></a>The execution of test cases (with parameters) depends on setup and teardown execution. Based on the <strong id="b1196952353418"><a name="b1196952353418"></a><a name="b1196952353418"></a>TEST_P</strong> macro, this macro has added the <strong id="b197642314343"><a name="b197642314343"></a><a name="b197642314343"></a>TestSize.Level1</strong> parameter to specify the test case level, for example, <strong id="b59797231348"><a name="b59797231348"></a><a name="b59797231348"></a>HWTEST_P(CalculatorAddTest, TestPoint_001, TestSize.Level1)</strong>.</p> 268</td> 269</tr> 270</tbody> 271</table> 272 273### How to Develop<a name="section53541946111218"></a> 274 2751. Define a test suite file based on the test case directory, for example, **test/developertest/examples/lite/cxx\_demo/test/unittest/common/calc\_subtraction\_test.cpp**. The class in this test suite should be inherited from the **testing::Test** class and named in the format of "_Tested feature_\_**Test**". 276 277 ``` 278 /* 279 * Copyright (c) 2020 OpenHarmony. 280 * Licensed under the Apache License, Version 2.0 (the "License"); 281 * you may not use this file except in compliance with the License. 282 * You may obtain a copy of the License at 283 * 284 * http://www.apache.org/licenses/LICENSE-2.0 285 * 286 * Unless required by applicable law or agreed to in writing, software 287 * distributed under the License is distributed on an "AS IS" BASIS, 288 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 289 * See the License for the specific language governing permissions and 290 * limitations under the License. 291 */ 292 #include <gtest/gtest.h> 293 294 using namespace std; 295 using namespace testing::ext; 296 297 class CalcSubtractionTest : public testing::Test { 298 public: 299 static void SetUpTestCase(void); 300 static void TearDownTestCase(void); 301 void SetUp(); 302 void TearDown(); 303 }; 304 ``` 305 306 > **NOTE:** 307 >You must write test cases by observing the following specifications: 308 >- Naming 309 > The source file name of a test case must be consistent with the test suite content. Each test suite has multiple test cases and a test source file that is globally unique and named in \[Feature\]\_\[Function\]\_\[Subfunction 1\]\_\[Subfunction 1.1\] format \(subfunctions can be further divided\). 310 > The file name can contain only lower-case letters and underscores \(\_\) and must end with **test**, for example, **developertest/examples/lite/cxx\_demo**. 311 >- Coding 312 > The test cases must comply with the coding specifications for feature code. In addition, case descriptions are required for further clarification. For details, see [Test case template](#li2069415903917). 313 >- Compilation and configuration 314 > The test cases must be compiled using GN, and the configurations must comply with the compilation guide of this open-source project. For details, see [Compilation and Building Subsystem - Lightweight and Small-Scale Systems](subsys-build-mini-lite.md). 315 >- <a name="li2069415903917"></a>Test case template 316 > For details, see the example test case **developertest/examples/lite/cxx\_demo/test/unittest/common/calc\_subtraction\_test.cpp**. 317 3182. Implement the preprocessing \(via the **SetUp** function\) and postprocessing \(via the **TearDown** function\) operations required by the execution of the test suite. 319 320 ``` 321 void CalcSubtractionTest::SetUpTestCase(void) 322 { 323 // step 1: input testsuite setup step 324 } 325 326 void CalcSubtractionTest::TearDownTestCase(void) 327 { 328 // step 2: input testsuite teardown step 329 } 330 331 void CalcSubtractionTest::SetUp(void) 332 { 333 // step 3: input testcase setup step 334 } 335 336 void CalcSubtractionTest::TearDown(void) 337 { 338 // step 4: input testcase teardown step 339 } 340 ``` 341 3423. Compile a test case based on the feature to be tested. The following code uses **HWTEST\_F** as an example: 343 344 ``` 345 /** 346 * @tc.name: integer_sub_001 347 * @tc.desc: Test Calculator 348 * @tc.type: FUNC 349 * @tc.require: AR00000000 SR00000000 350 */ 351 HWTEST_F(CalcSubtractionTest, integer_sub_001, TestSize.Level1) 352 { 353 EXPECT_EQ(0, Subtraction(1, 0)); 354 } 355 ``` 356 357 > **NOTE:** 358 >- **@tc.name**: test case name, which briefly describes the test purpose 359 >- **@tc.desc**: detailed description of the test case, including the test purpose, test procedure, and expected result 360 >- **@tc.type**: test type, which can be **FUNC**, **PERF**, **SECU**, or **RELI**. 361 >- **@tc.require**: requirement ID or issue ID, which is used to associate the modification with the test case 362 363 <a name="table32731243909"></a> 364 <table><thead align="left"><tr id="row16325154317013"><th class="cellrowborder" valign="top" width="7.3999999999999995%" id="mcps1.1.5.1.1"><p id="p7325134310013"><a name="p7325134310013"></a><a name="p7325134310013"></a>SN</p> 365 </th> 366 <th class="cellrowborder" valign="top" width="38.269999999999996%" id="mcps1.1.5.1.2"><p id="p16325134310015"><a name="p16325134310015"></a><a name="p16325134310015"></a>Test Type</p> 367 </th> 368 <th class="cellrowborder" valign="top" width="8.82%" id="mcps1.1.5.1.3"><p id="p1032516431404"><a name="p1032516431404"></a><a name="p1032516431404"></a>Code</p> 369 </th> 370 <th class="cellrowborder" valign="top" width="45.51%" id="mcps1.1.5.1.4"><p id="p1832594320017"><a name="p1832594320017"></a><a name="p1832594320017"></a>Description</p> 371 </th> 372 </tr> 373 </thead> 374 <tbody><tr id="row183251943601"><td class="cellrowborder" valign="top" width="7.3999999999999995%" headers="mcps1.1.5.1.1 "><p id="p33251343305"><a name="p33251343305"></a><a name="p33251343305"></a>1</p> 375 </td> 376 <td class="cellrowborder" valign="top" width="38.269999999999996%" headers="mcps1.1.5.1.2 "><p id="p032514432018"><a name="p032514432018"></a><a name="p032514432018"></a>Functionality test</p> 377 </td> 378 <td class="cellrowborder" valign="top" width="8.82%" headers="mcps1.1.5.1.3 "><p id="p133252437011"><a name="p133252437011"></a><a name="p133252437011"></a>FUNC</p> 379 </td> 380 <td class="cellrowborder" valign="top" width="45.51%" headers="mcps1.1.5.1.4 "><p id="p1332554310018"><a name="p1332554310018"></a><a name="p1332554310018"></a>Verifies that each functionality of the software complies with the function design and specifications.</p> 381 </td> 382 </tr> 383 <tr id="row1632584311011"><td class="cellrowborder" valign="top" width="7.3999999999999995%" headers="mcps1.1.5.1.1 "><p id="p19325743609"><a name="p19325743609"></a><a name="p19325743609"></a>2</p> 384 </td> 385 <td class="cellrowborder" valign="top" width="38.269999999999996%" headers="mcps1.1.5.1.2 "><p id="p73251343404"><a name="p73251343404"></a><a name="p73251343404"></a>Performance test</p> 386 </td> 387 <td class="cellrowborder" valign="top" width="8.82%" headers="mcps1.1.5.1.3 "><p id="p23251543503"><a name="p23251543503"></a><a name="p23251543503"></a>PERF</p> 388 </td> 389 <td class="cellrowborder" valign="top" width="45.51%" headers="mcps1.1.5.1.4 "><p id="p8325114311015"><a name="p8325114311015"></a><a name="p8325114311015"></a>Verifies that the software meets the performance requirements. Performance tests include load tests, capacitance tests, and pressure tests.</p> 390 </td> 391 </tr> 392 <tr id="row3325243205"><td class="cellrowborder" valign="top" width="7.3999999999999995%" headers="mcps1.1.5.1.1 "><p id="p19325114310015"><a name="p19325114310015"></a><a name="p19325114310015"></a>3</p> 393 </td> 394 <td class="cellrowborder" valign="top" width="38.269999999999996%" headers="mcps1.1.5.1.2 "><p id="p183266439019"><a name="p183266439019"></a><a name="p183266439019"></a>Security test</p> 395 </td> 396 <td class="cellrowborder" valign="top" width="8.82%" headers="mcps1.1.5.1.3 "><p id="p632617439016"><a name="p632617439016"></a><a name="p632617439016"></a>SECU</p> 397 </td> 398 <td class="cellrowborder" valign="top" width="45.51%" headers="mcps1.1.5.1.4 "><p id="p133261343301"><a name="p133261343301"></a><a name="p133261343301"></a>Verifies that the software complies with security requirements and related laws and regulations within the software lifecycle.</p> 399 </td> 400 </tr> 401 <tr id="row33261843508"><td class="cellrowborder" valign="top" width="7.3999999999999995%" headers="mcps1.1.5.1.1 "><p id="p123263435018"><a name="p123263435018"></a><a name="p123263435018"></a>4</p> 402 </td> 403 <td class="cellrowborder" valign="top" width="38.269999999999996%" headers="mcps1.1.5.1.2 "><p id="p78251846615"><a name="p78251846615"></a><a name="p78251846615"></a>Reliability test</p> 404 </td> 405 <td class="cellrowborder" valign="top" width="8.82%" headers="mcps1.1.5.1.3 "><p id="p1732615435011"><a name="p1732615435011"></a><a name="p1732615435011"></a>RELI</p> 406 </td> 407 <td class="cellrowborder" valign="top" width="45.51%" headers="mcps1.1.5.1.4 "><p id="p103261243906"><a name="p103261243906"></a><a name="p103261243906"></a>Verifies the probability that the software does not cause system failures within a specified period of time and under given conditions. Software stability is also involved in the test.</p> 408 </td> 409 </tr> 410 </tbody> 411 </table> 412 4134. Compile the GN file of the test case, including defining the compilation target, adding compilation dependencies, and setting the source file. 414 415 Example file path: **test/developertest/examples/lite/cxx\_demo/test/unittest/common/BUILD.gn** 416 417 ``` 418 import("//build/lite/config/test.gni") 419 420 unittest("CalcSubTest") { 421 output_extension = "bin" 422 sources = [ 423 "calc_subtraction_test.cpp" 424 ] 425 include_dirs = [] 426 deps = [] 427 } 428 ``` 429 4305. Add the compilation target to the subsystem compilation configuration to ensure that the test case is compiled with the version distribution. The following is an example: 431 1. For devices that support connection to the Harmony device connector \(hdc\), the example compilation configuration directory is **test/developertest/examples/ohos.build**. 432 433 ``` 434 { 435 "subsystem": "subsystem_examples", 436 "parts": { 437 "subsystem_examples": { 438 "module_list": [ 439 "//test/developertest/examples/detector:detector", 440 ... 441 ], 442 "test_list": [ 443 "//test/developertest/examples/detector/test:unittest", 444 ... 445 ] 446 }, 447 ... 448 } 449 ``` 450 451 2. For devices that support serial ports only, the example compilation configuration directory is **test/developertest/examples/lite/BUILD.gn**. 452 453 ``` 454 import("//build/lite/config/test.gni") 455 456 subsystem_test("test") { 457 test_components = [] 458 if(ohos_kernel_type == "liteos_riscv") { 459 features += [ 460 ] 461 }else if(ohos_kernel_type == "liteos_a") { 462 test_components += [ 463 "//test/developertest/examples/lite/cxx_demo/test/unittest/common:CalcSubTest" 464 ] 465 } 466 } 467 ``` 468 4696. Create a resource configuration file for the test case to use static resources. 470 1. Create the **resource** directory in the **test** directory of a component or module. 471 2. Create a directory for a device type, for example, **phone**, in the **resource** directory. 472 3. Create a folder named after the module in the device type directory, for example, **testmodule**. 473 4. Create the **ohos\_test.xml** file in the folder named after the module. The file content is in the following format: 474 475 ``` 476 <?xml version="1.0" encoding="UTF-8"?> 477 <configuration ver="2.0"> 478 <target name="DetectorFileTest"> 479 <preparer> 480 <option name="push" value="test.txt -> /data/test/resource" src="res"/> 481 </preparer> 482 </target> 483 </configuration> 484 ``` 485 486 5. Define **resource\_config\_file** in the compilation configuration file of the test case to specify the resource file **ohos\_test.xml**. 487 488 > **NOTE:** 489 >The resource file is used to push the **test.txt** file in the **resource** directory to the **/data/test/resource** directory of the device to test. To do so, run the **hdc push** command. 490 491 4927. Execute the test case after it is compiled \(the preceding steps are complete\). 493 494 > **NOTE:** 495 >- For devices that support connection to the hdc, test cases can be compiled separately. 496 >- For devices that support serial ports only, to compile the test case, run the commands in the root directory for compiling the debug code. 497 > For details about how to execute a test case, see [How to Use the Test Platform](#section76401945124810). 498 499 500## Development Example<a name="section7477121918136"></a> 501 502The code repository of the testing subsystem provides complete demo cases, which are available in the **test/developertest/examples/** directory. The following is an example of compiling a test case for a subtraction function: 503 504- The tested code is as follows: 505 506 ``` 507 static int Subtraction(int a, int b) 508 { 509 return a - b; 510 } 511 ``` 512 513- The test case code is as follows: 514 515 ``` 516 /** 517 * @tc.name: integer_sub_002 518 * @tc.desc: Verify the Subtraction function. 519 * @tc.type: FUNC 520 * @tc.require: AR00000000 SR00000000 521 */ 522 HWTEST_F(CalcSubtractionTest, integer_sub_002, TestSize.Level1) 523 { 524 EXPECT_EQ(1, Subtraction(2, 1)); 525 } 526 ``` 527 528 529## How to Use the Test Platform<a name="section76401945124810"></a> 530 5311. \(Optional\) Install the XDevice component. XDevice can be used as a Python extension package. 532 533 Go to the installation directory **test/xdevice** and run the following command: 534 535 ``` 536 python setup.py install 537 ``` 538 539 If the installation is successful, the following prompts are displayed: 540 541 ``` 542 ... 543 Installed d:\programs\python37\lib\site-packages\xdevice-0.0.0-py3.7.egg 544 Processing dependencies for xdevice==0.0.0 545 Searching for pyserial==3.4 546 Best match: pyserial 3.4 547 Processing pyserial-3.4-py3.7.egg 548 pyserial 3.4 is already the active version in easy-install.pth 549 Installing miniterm.py script to D:\Programs\Python37\Scripts 550 551 Using d:\programs\python37\lib\site-packages\pyserial-3.4-py3.7.egg 552 Finished processing dependencies for xdevice==0.0.0 553 ``` 554 5552. Modify the **developertest/config/user\_config.xml** file to configure the Developertest component. 556 1. Modify basic configuration parameters. 557 558 \[build\] \# Set build parameters of the test case. 559 560 ``` 561 <build> 562 <example>false</example> 563 <version>false</version> 564 <testcase>true</testcase> 565 ... ... 566 </build> 567 ``` 568 569 > **NOTE:** 570 >**example**: whether to build the test case example. The default value is **false**. 571 >**version**: whether to build the test version. The default value is **false**. 572 >**testcase**: whether to build the test case. The default value is **true**. 573 574 2. For devices that support connection to the hdc, modify the configuration file as follows: 575 576 Between the **device** tags with the **"usb-hdc"** attribute, modify the IP address of the device and the port number matching the HDC connection. For example: 577 578 ``` 579 <device type="usb-hdc"> 580 <ip>192.168.1.1</ip> 581 <port>9111</port> 582 <sn></sn> 583 </device> 584 ``` 585 586 3. For devices that support serial ports only, modify the configuration file as follows: 587 588 \[board\_info\] \# Configure development board information. 589 590 ``` 591 <board_info> 592 <board_series>hispark</board_series> 593 <board_type>taurus</board_type> 594 <board_product>ipcamera</board_product> 595 <build_command>hb build</build_command> 596 </board_info> 597 ``` 598 599 > **NOTE:** 600 >**board\_series**: development board series. The default value is **hispark**. 601 >**board\_type**: development board type. The default value is **taurus**. 602 >**board\_product**: target product. The default value is **ipcamera**. 603 >**build\_command**: command used for building the test version and test case. The default value is **hb build**. 604 605 Between the **device** tags with the **"ipcamera"** attribute, modify the serial port information, including the COM port and baud rate. For example: 606 607 ``` 608 <device type="com" label="ipcamera"> 609 <serial> 610 <com>COM1</com> 611 <type>cmd</type> 612 <baud_rate>115200</baud_rate> 613 <data_bits>8</data_bits> 614 <stop_bits>1</stop_bits> 615 <timeout>1</timeout> 616 </serial> 617 </device> 618 ``` 619 6203. \(Optional\) Modify the Developertest configuration. If a test case has been compiled, specify the compilation output path of the test case. In this case the test platform will not recompile the test case. 621 622 Modify the **config/user\_config.xml** file. 623 624 1. Specify the output path of the test case, that is, the compilation output directory between the **test\_cases** tags. Example: 625 626 ``` 627 <test_cases> 628 <dir>/home/opencode/out/release/tests</dir> 629 </test_cases> 630 ``` 631 632 2. For devices that support serial ports only, specify the NFS directory on the PC \(**host\_dir**\) and the corresponding directory on the board \(**board\_dir**\) between the **NFS** tags. For example: 633 634 ``` 635 <NFS> 636 <host_dir>D:\nfs</host_dir> 637 <board_dir>user</board_dir> 638 </NFS> 639 ``` 640 6414. \(Optional\) Prepare the test environment. If devices to be tested support only serial ports, check whether the environment is ready: 642 - The system image and file system have been burnt into the development board and are running properly on it. For example, in system mode, if the device prompt **OHOS\#** when you log in with the shell, the system is running properly. 643 - The development host has been connected to the serial port of the development board and the network port. 644 - IP addresses of the development host and development board are in the same network segment and can ping each other. 645 - An empty directory has been created on the development host for mounting test cases through NFS, and the NFS service has been started properly. 646 6475. Start the test platform and execute the test case. 648 - Start the test framework, go to the **test/developertest** directory, and execute the startup script. 649 1. Run the following command to start the test framework in Windows: 650 651 ``` 652 start.bat 653 ``` 654 655 2. Run the following command to start the test framework in Linux: 656 657 ``` 658 ./start.sh 659 ``` 660 661 - Select a device type. 662 663 Configure the device type based on the development board in the configuration file, for example, **developertest/config/framework\_config.xml**. 664 665 - Run test commands. 666 1. To query the subsystems, modules, product form, and test types supported by test cases, run the **show** commands. 667 668 ``` 669 Usage: 670 show productlist Query supported product forms 671 show typelist Query the supported test type 672 show subsystemlist Query supported subsystems 673 show modulelist Query supported modules 674 ``` 675 676 2. Run test commands. **-t** is mandatory, and **-ss** and **-tm** are optional. The following is an example: 677 678 ``` 679 run -t ut -ss subsystem_examples -tm calculator 680 ``` 681 682 3. Specify the arguments to execute the test suite for a specific feature or module. 683 684 ``` 685 usage: run [-h] [-p PRODUCTFORM] [-t [TESTTYPE [TESTTYPE ...]]] 686 [-ss SUBSYSTEM] [-tm TESTMODULE] [-ts TESTSUIT] 687 [-tc TESTCASE] [-tl TESTLEVEL] 688 689 Optional arguments: 690 -h, --help Show this help message and exit. 691 -p PRODUCTFORM, --productform PRODUCTFORM Specified product form 692 -t [TESTTYPE [TESTTYPE ...]], --testtype [TESTTYPE [TESTTYPE ...]] 693 Specify test type(UT,MST,ST,PERF,ALL) 694 -ss SUBSYSTEM, --subsystem SUBSYSTEM Specify test subsystem 695 -tm TESTMODULE, --testmodule TESTMODULE Specified test module 696 -ts TESTSUIT, --testsuite TESTSUIT Specify test suite 697 -tc TESTCASE, --testcase TESTCASE Specify test case 698 -tl TESTLEVEL, --testlevel TESTLEVEL Specify test level 699 ``` 700 701 - View the test framework help if needed. 702 703 Run the following command query test commands that are supported by the test platform: 704 705 ``` 706 help 707 ``` 708 709 - Exit the test platform. 710 711 Run the following command to exit the test platform: 712 713 ``` 714 quit 715 ``` 716 7176. View the test result and logs. The test logs and reports are generated in the **developertest/reports** directory after you run the test commands. 718 - The test result is displayed on the console. The root path of the test result is as follows: 719 720 ``` 721 reports/xxxx-xx-xx-xx-xx-xx 722 ``` 723 724 - The test case formatting result is stored in the following directory: 725 726 ``` 727 result/ 728 ``` 729 730 - The test logs are stored in the following directory: 731 732 ``` 733 log/plan_log_xxxx-xx-xx-xx-xx-xx.log 734 ``` 735 736 - The report summary file is as follows: 737 738 ``` 739 summary_report.html 740 ``` 741 742 - The report details file is as follows: 743 744 ``` 745 details_report.html 746 ``` 747 748 - The log directory of the test platform is as follows: 749 750 ``` 751 reports/platform_log_xxxx-xx-xx-xx-xx-xx.log 752 ``` 753 754 755 756## Directory Structure<a name="section1875515364133"></a> 757 758The source code of XDevice is stored in the **test/xdevice** directory. The following table describes the **xdevice** directory structure. 759 760**Table 4** XDevice structure 761 762<a name="table954494411114"></a> 763<table><thead align="left"><tr id="row5545104415118"><th class="cellrowborder" valign="top" width="45.050000000000004%" id="mcps1.2.3.1.1"><p id="p2054554411115"><a name="p2054554411115"></a><a name="p2054554411115"></a>Directory</p> 764</th> 765<th class="cellrowborder" valign="top" width="54.949999999999996%" id="mcps1.2.3.1.2"><p id="p13545124420115"><a name="p13545124420115"></a><a name="p13545124420115"></a>Description</p> 766</th> 767</tr> 768</thead> 769<tbody><tr id="row185457441816"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p754544411116"><a name="p754544411116"></a><a name="p754544411116"></a>xdevice</p> 770</td> 771<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p05459441212"><a name="p05459441212"></a><a name="p05459441212"></a>Basic components of the test platform</p> 772</td> 773</tr> 774<tr id="row454511442018"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p75451144810"><a name="p75451144810"></a><a name="p75451144810"></a>xdevice/src/xdevice</p> 775</td> 776<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p105453448111"><a name="p105453448111"></a><a name="p105453448111"></a>Source code for the basic test framework</p> 777</td> 778</tr> 779<tr id="row87541401381"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p67551309382"><a name="p67551309382"></a><a name="p67551309382"></a>xdevice/config</p> 780</td> 781<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p1575512093811"><a name="p1575512093811"></a><a name="p1575512093811"></a>Configuration file of the basic test framework</p> 782</td> 783</tr> 784<tr id="row5649112018488"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p196491420164819"><a name="p196491420164819"></a><a name="p196491420164819"></a>xdevice/src/xdevice/__main__.py</p> 785</td> 786<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p10650320204819"><a name="p10650320204819"></a><a name="p10650320204819"></a>Internal entrance to the basic test framework</p> 787</td> 788</tr> 789<tr id="row686513384812"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p886514334481"><a name="p886514334481"></a><a name="p886514334481"></a>xdevice/src/xdevice/__init__.py</p> 790</td> 791<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p1986519338482"><a name="p1986519338482"></a><a name="p1986519338482"></a>Package and plug-in dependencies</p> 792</td> 793</tr> 794<tr id="row4833912191119"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p1083418127115"><a name="p1083418127115"></a><a name="p1083418127115"></a>xdevice/src/xdevice/variables.py</p> 795</td> 796<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p138341712101118"><a name="p138341712101118"></a><a name="p138341712101118"></a>Global variables</p> 797</td> 798</tr> 799<tr id="row1637375614140"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p8373105615143"><a name="p8373105615143"></a><a name="p8373105615143"></a>xdevice/src/xdevice/_core/command</p> 800</td> 801<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p1937319561140"><a name="p1937319561140"></a><a name="p1937319561140"></a>Commands input by test cases</p> 802</td> 803</tr> 804<tr id="row10415205961418"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p184151659131413"><a name="p184151659131413"></a><a name="p184151659131413"></a>xdevice/src/xdevice/_core/config</p> 805</td> 806<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p1986220312212"><a name="p1986220312212"></a><a name="p1986220312212"></a>Configuration management of the basic test framework</p> 807</td> 808</tr> 809<tr id="row94787251511"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p174781520154"><a name="p174781520154"></a><a name="p174781520154"></a>xdevice/src/xdevice/_core/environment</p> 810</td> 811<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p164783210154"><a name="p164783210154"></a><a name="p164783210154"></a>Environment management of the basic test framework, including device management</p> 812</td> 813</tr> 814<tr id="row61686255266"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p81691225162617"><a name="p81691225162617"></a><a name="p81691225162617"></a>xdevice/src/xdevice/_core/executor</p> 815</td> 816<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p1316918254269"><a name="p1316918254269"></a><a name="p1316918254269"></a>Scheduling and distribution of test cases</p> 817</td> 818</tr> 819<tr id="row197501910202715"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p1375091013272"><a name="p1375091013272"></a><a name="p1375091013272"></a>xdevice/src/xdevice/_core/driver</p> 820</td> 821<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p10750101062710"><a name="p10750101062710"></a><a name="p10750101062710"></a>Test executor for the basic test framework</p> 822</td> 823</tr> 824<tr id="row176501346185920"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p66514461593"><a name="p66514461593"></a><a name="p66514461593"></a>xdevice/src/xdevice/_core/resource</p> 825</td> 826<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p15651746155911"><a name="p15651746155911"></a><a name="p15651746155911"></a>Resource files and test report templates for the basic test framework</p> 827</td> 828</tr> 829<tr id="row1484675718210"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p20847105792118"><a name="p20847105792118"></a><a name="p20847105792118"></a>xdevice/src/xdevice/_core/testkit</p> 830</td> 831<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p784795762120"><a name="p784795762120"></a><a name="p784795762120"></a>Common operations for the basic test framework, including NFS mounting</p> 832</td> 833</tr> 834<tr id="row182104023911"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p5211808398"><a name="p5211808398"></a><a name="p5211808398"></a>xdevice/src/xdevice/_core/logger.py</p> 835</td> 836<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p92110017395"><a name="p92110017395"></a><a name="p92110017395"></a>Log management of the basic test framework</p> 837</td> 838</tr> 839<tr id="row164491410124017"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p7449171012400"><a name="p7449171012400"></a><a name="p7449171012400"></a>xdevice/src/xdevice/_core/plugin.py</p> 840</td> 841<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p1944991024013"><a name="p1944991024013"></a><a name="p1944991024013"></a>Plug-in management of the basic test framework</p> 842</td> 843</tr> 844<tr id="row14857134011406"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p118571440104014"><a name="p118571440104014"></a><a name="p118571440104014"></a>xdevice/src/xdevice/_core/interface.py</p> 845</td> 846<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p158571940184016"><a name="p158571940184016"></a><a name="p158571940184016"></a>Interfaces for plug-ins of the basic test framework</p> 847</td> 848</tr> 849<tr id="row94193383812"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p154194363813"><a name="p154194363813"></a><a name="p154194363813"></a>xdevice/setup.py</p> 850</td> 851<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p44193353819"><a name="p44193353819"></a><a name="p44193353819"></a>Installation script of the basic test framework</p> 852</td> 853</tr> 854<tr id="row537019532284"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p63711953202815"><a name="p63711953202815"></a><a name="p63711953202815"></a>xdevice/run.bat</p> 855</td> 856<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p4371153172812"><a name="p4371153172812"></a><a name="p4371153172812"></a>Startup script of the basic test framework (Windows)</p> 857</td> 858</tr> 859<tr id="row554513912325"><td class="cellrowborder" valign="top" width="45.050000000000004%" headers="mcps1.2.3.1.1 "><p id="p165451493324"><a name="p165451493324"></a><a name="p165451493324"></a>xdevice/run.sh</p> 860</td> 861<td class="cellrowborder" valign="top" width="54.949999999999996%" headers="mcps1.2.3.1.2 "><p id="p165453953218"><a name="p165453953218"></a><a name="p165453953218"></a>Startup script of the basic test framework (Linux)</p> 862</td> 863</tr> 864</tbody> 865</table> 866 867The source code of Developertest is stored in the **test/developertest** directory. The following table describes the **developertest** directory structure. 868 869**Table 5** Developertest structure 870 871<a name="table2977131081412"></a> 872<table><thead align="left"><tr id="row7977610131417"><th class="cellrowborder" valign="top" width="33.879999999999995%" id="mcps1.2.3.1.1"><p id="p18792459121314"><a name="p18792459121314"></a><a name="p18792459121314"></a>Directory</p> 873</th> 874<th class="cellrowborder" valign="top" width="66.12%" id="mcps1.2.3.1.2"><p id="p77921459191317"><a name="p77921459191317"></a><a name="p77921459191317"></a>Description</p> 875</th> 876</tr> 877</thead> 878<tbody><tr id="row17977171010144"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p2793159171311"><a name="p2793159171311"></a><a name="p2793159171311"></a>developertest</p> 879</td> 880<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p879375920132"><a name="p879375920132"></a><a name="p879375920132"></a>Development test framework</p> 881</td> 882</tr> 883<tr id="row259142201312"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p640585013134"><a name="p640585013134"></a><a name="p640585013134"></a>developertest/src</p> 884</td> 885<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p10406450131319"><a name="p10406450131319"></a><a name="p10406450131319"></a>Test framework source code</p> 886</td> 887</tr> 888<tr id="row1188919458130"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p115448132141"><a name="p115448132141"></a><a name="p115448132141"></a>developertest/src/core</p> 889</td> 890<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p1254413131146"><a name="p1254413131146"></a><a name="p1254413131146"></a>Test executor</p> 891</td> 892</tr> 893<tr id="row6978161091412"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p37931659101311"><a name="p37931659101311"></a><a name="p37931659101311"></a>developertest/src/core/build</p> 894</td> 895<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p6793059171318"><a name="p6793059171318"></a><a name="p6793059171318"></a>Test case compilation</p> 896</td> 897</tr> 898<tr id="row6978201031415"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p1738210441049"><a name="p1738210441049"></a><a name="p1738210441049"></a>developertest/src/core/command</p> 899</td> 900<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p1629020401941"><a name="p1629020401941"></a><a name="p1629020401941"></a>Processing of command lines entered by users</p> 901</td> 902</tr> 903<tr id="row1596814581415"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p158313363613"><a name="p158313363613"></a><a name="p158313363613"></a>developertest/src/core/config</p> 904</td> 905<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p12969358749"><a name="p12969358749"></a><a name="p12969358749"></a>Test framework configuration management</p> 906</td> 907</tr> 908<tr id="row175618551244"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p73791172718"><a name="p73791172718"></a><a name="p73791172718"></a>developertest/src/core/driver</p> 909</td> 910<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p107568558416"><a name="p107568558416"></a><a name="p107568558416"></a>Test framework driver executor</p> 911</td> 912</tr> 913<tr id="row114431614115"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p1644216201111"><a name="p1644216201111"></a><a name="p1644216201111"></a>developertest/src/core/resource</p> 914</td> 915<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p15441116171113"><a name="p15441116171113"></a><a name="p15441116171113"></a>Test framework configuration file</p> 916</td> 917</tr> 918<tr id="row16289143217239"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p82908327236"><a name="p82908327236"></a><a name="p82908327236"></a>developertest/src/core/testcase</p> 919</td> 920<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p129013219235"><a name="p129013219235"></a><a name="p129013219235"></a>Test case management</p> 921</td> 922</tr> 923<tr id="row1403172313113"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p5403202371115"><a name="p5403202371115"></a><a name="p5403202371115"></a>developertest/src/core/common.py</p> 924</td> 925<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p84031423201110"><a name="p84031423201110"></a><a name="p84031423201110"></a>Common operations on the test framework</p> 926</td> 927</tr> 928<tr id="row1688681821114"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p4886718121111"><a name="p4886718121111"></a><a name="p4886718121111"></a>developertest/src/core/constants.py</p> 929</td> 930<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p10886151811115"><a name="p10886151811115"></a><a name="p10886151811115"></a>Global constants of the test framework</p> 931</td> 932</tr> 933<tr id="row13247163492"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p710851611910"><a name="p710851611910"></a><a name="p710851611910"></a>developertest/src/core/exception.py</p> 934</td> 935<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p112471431895"><a name="p112471431895"></a><a name="p112471431895"></a>Test framework exceptions</p> 936</td> 937</tr> 938<tr id="row1392104161718"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p292154131715"><a name="p292154131715"></a><a name="p292154131715"></a>developertest/src/core/utils.py</p> 939</td> 940<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p139224117173"><a name="p139224117173"></a><a name="p139224117173"></a>Test framework tools and methods</p> 941</td> 942</tr> 943<tr id="row43471438181714"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p1134883851719"><a name="p1134883851719"></a><a name="p1134883851719"></a>developertest/src/main</p> 944</td> 945<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p7348123861711"><a name="p7348123861711"></a><a name="p7348123861711"></a>Test framework platform</p> 946</td> 947</tr> 948<tr id="row144751036111712"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p16475163681716"><a name="p16475163681716"></a><a name="p16475163681716"></a>developertest/src/main/__main__.py</p> 949</td> 950<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p11475103641712"><a name="p11475103641712"></a><a name="p11475103641712"></a>Internal entrance of the test framework</p> 951</td> 952</tr> 953<tr id="row11435113411716"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p4435153416170"><a name="p4435153416170"></a><a name="p4435153416170"></a>developertest/examples</p> 954</td> 955<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p643523491711"><a name="p643523491711"></a><a name="p643523491711"></a>Test framework demo cases</p> 956</td> 957</tr> 958<tr id="row988116194289"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p7881161913283"><a name="p7881161913283"></a><a name="p7881161913283"></a>developertest/third_party</p> 959</td> 960<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p58815196285"><a name="p58815196285"></a><a name="p58815196285"></a>Third-party components</p> 961</td> 962</tr> 963<tr id="row11235133231718"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p19235153291712"><a name="p19235153291712"></a><a name="p19235153291712"></a>developertest/BUILD.gn</p> 964</td> 965<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p19235143291715"><a name="p19235143291715"></a><a name="p19235143291715"></a>Compilation configuration of the subsystem</p> 966</td> 967</tr> 968<tr id="row153133019174"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p163153019174"><a name="p163153019174"></a><a name="p163153019174"></a>developertest/start.bat</p> 969</td> 970<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p194133051713"><a name="p194133051713"></a><a name="p194133051713"></a>Developer test entry (Windows)</p> 971</td> 972</tr> 973<tr id="row6640152712173"><td class="cellrowborder" valign="top" width="33.879999999999995%" headers="mcps1.2.3.1.1 "><p id="p2641202751712"><a name="p2641202751712"></a><a name="p2641202751712"></a>developertest/start.sh</p> 974</td> 975<td class="cellrowborder" valign="top" width="66.12%" headers="mcps1.2.3.1.2 "><p id="p86419276175"><a name="p86419276175"></a><a name="p86419276175"></a>Developer test entry (Linux)</p> 976</td> 977</tr> 978</tbody> 979</table> 980 981