@@ -112,12 +112,14 @@ The HCTest framework is used to support test cases developed with the C language
2. Write the test case in the **src** directory.
1 Import the test framework header file.
1. Import the test framework header file.
```
#include "hctest.h"
```
2. Use the **LITE\_TEST\_SUIT** macro to define names of the subsystem, module, and test suite.
```
...
...
@@ -147,12 +149,16 @@ The HCTest framework is used to support test cases developed with the C language
};
```
5. Use the **RUN\_TEST\_SUITE** macro to register the test suite.
```
RUN_TEST_SUITE(IntTestSuite);
```
3. Create the configuration file \(**BUILD.gn**\) of the test module.
Create a **BUILD.gn**\(example\) build file in each test module directory. Specify the name of the built static library and its dependent header file and library in the build file. The format is as follows:
...
...
@@ -239,6 +245,8 @@ The HCPPTest framework is enhanced and adapted based on the open-source framewor
#include "gtest/gtest.h"
```
2. Define Setup and TearDown.
```
...
...
@@ -263,6 +271,8 @@ The HCPPTest framework is enhanced and adapted based on the open-source framewor
};
```
3. Use the **HWTEST** or **HWTEST\_F** macro to write the test case.
**HWTEST**: definition of common test cases, including the test suite name, test case name, and case annotation.
...
...
@@ -277,6 +287,8 @@ The HCPPTest framework is enhanced and adapted based on the open-source framewor
}
```
3. Create a configuration file \(**BUILD.gn**\) of the test module.
Create a **BUILD.gn** build file in each test module directory. Specify the name of the built static library and its dependent header file and library in the build file. Each test module is independently built into a **.bin** executable file, which can be directly pushed to the development board for testing.