Merge pull request #1202 from hxy7yx/main

Add README for ut and ft
This commit is contained in:
fengzeroz
2023-04-20 09:56:19 +08:00
committed by GitHub
2 changed files with 39 additions and 4 deletions
+35
View File
@@ -0,0 +1,35 @@
# Functional test
Functional testing uses the robotframework automated testing framework, providing templates for each test case of the northbound APP and southbound DRIVER types.
Testing is divided into the following categories.
|Test case|Description|
|-----|----------|
|Core interface test|Mainly including the addition, deletion, modification, query, subscription, and other operations of the HTTP API interface for core data(PLUGIN, NODE, GROUP, TAG)|
|Southbound DRIVER test||
|Northbound APP test||
|Plugin specific test case|Such as OPC UA specific device discovery, can different devices be connected normally|
To run all functional testers
Enter the neuron/build directory.
Install Mosquito software.
```shell
$ sudo apt-get install -y mosquitto
```
Start the mosquitto server.
```shell
$ mosquitto -v &
```
Install requirements.
```shell
$ python3 -m pip install -U pip
$ python3 -m pip install -r ft/requirements.txt
```
Run functional tests and generate test reports.
```shell
$ python3 -m robot --maxerroelines=600 -P ft/ -d ft/reports ft
```
+4 -4
View File
@@ -1,15 +1,15 @@
# Test
To run all unit testers
Unit testing uses googletest testing framework, testing point processing, JSON reading, architecture, HTTP acquisition, and other small-scale tests.
To run all unit tests.
```shell
$ cd build
$ ctest --output-on-failure
```
Introducing coverage statistics using LCOV
To introduce coverage statistics using LCOV:
Adding parameter -DUSE_GCOV=1 during compilation.
Add parameter -DUSE_GCOV=1 during compilation
Generate image files .gcno and data files .gcda under build/tests/CMakeFiles/.dir