mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 10:17:45 +08:00
New Crowdin translations - zh-CN (#24563)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
@@ -125,19 +125,19 @@ To write a new test:
|
||||
|
||||
- Start the simulator:
|
||||
|
||||
```sh
|
||||
cd <PX4-Autopilot_clone>
|
||||
source Tools/simulation/gazebo/setup_gazebo.bash
|
||||
roslaunch launch/mavros_posix_sitl.launch
|
||||
```
|
||||
```sh
|
||||
cd <PX4-Autopilot_clone>
|
||||
source Tools/simulation/gazebo/setup_gazebo.bash
|
||||
roslaunch launch/mavros_posix_sitl.launch
|
||||
```
|
||||
|
||||
- Run test (in a new shell):
|
||||
|
||||
```sh
|
||||
cd <PX4-Autopilot_clone>
|
||||
source Tools/simulation/gazebo/setup_gazebo.bash
|
||||
rosrun px4 mavros_new_test.py
|
||||
```
|
||||
```sh
|
||||
cd <PX4-Autopilot_clone>
|
||||
source Tools/simulation/gazebo/setup_gazebo.bash
|
||||
rosrun px4 mavros_new_test.py
|
||||
```
|
||||
|
||||
3. Add new test node to a launch file
|
||||
|
||||
|
||||
@@ -126,34 +126,34 @@ It can be run directly in a debugger, however be careful to only run one test pe
|
||||
|
||||
10. Within [tests_main.h](https://github.com/PX4/PX4-Autopilot/blob/main/src/systemcmds/tests/tests_main.h) define the new test:
|
||||
|
||||
```cpp
|
||||
extern int test_[description](int argc, char *argv[]);
|
||||
```
|
||||
```cpp
|
||||
extern int test_[description](int argc, char *argv[]);
|
||||
```
|
||||
|
||||
11. Within [tests_main.c](https://github.com/PX4/PX4-Autopilot/blob/main/src/systemcmds/tests/tests_main.c) add description name, test function and option:
|
||||
|
||||
```cpp
|
||||
...
|
||||
} tests[] = {
|
||||
{...
|
||||
{"[description]", test_[description], OPTION},
|
||||
...
|
||||
}
|
||||
```
|
||||
```cpp
|
||||
...
|
||||
} tests[] = {
|
||||
{...
|
||||
{"[description]", test_[description], OPTION},
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
`OPTION` can be `OPT_NOALLTEST`,`OPT_NOJIGTEST` or `0` and is considered if within px4 shell one of the two commands are called:
|
||||
`OPTION` can be `OPT_NOALLTEST`,`OPT_NOJIGTEST` or `0` and is considered if within px4 shell one of the two commands are called:
|
||||
|
||||
```sh
|
||||
pxh> tests all
|
||||
```
|
||||
```sh
|
||||
pxh> tests all
|
||||
```
|
||||
|
||||
或
|
||||
或
|
||||
|
||||
```sh
|
||||
pxh> tests jig
|
||||
```
|
||||
```sh
|
||||
pxh> tests jig
|
||||
```
|
||||
|
||||
If a test has option `OPT_NOALLTEST`, then that test will be excluded when calling `tests all`. The same is true for `OPT_NOJITEST` when command `test jig` is called. Option `0` means that the test is never excluded, which is what most developer want to use.
|
||||
If a test has option `OPT_NOALLTEST`, then that test will be excluded when calling `tests all`. The same is true for `OPT_NOJITEST` when command `test jig` is called. Option `0` means that the test is never excluded, which is what most developer want to use.
|
||||
|
||||
12. Add the test `test_[description].cpp` to the [CMakeLists.txt](https://github.com/PX4/PX4-Autopilot/blob/main/src/systemcmds/tests/CMakeLists.txt).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user