mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
tests template skip mavlink except for mavlink test
This commit is contained in:
+1
-1
@@ -98,7 +98,7 @@ pushd "$rootfs" >/dev/null
|
|||||||
# Do not exit on failure now from here on because we want the complete cleanup
|
# Do not exit on failure now from here on because we want the complete cleanup
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
if [[ ${model} == tests* ]] || [[ ${model} == *_generated ]]; then
|
if [[ ${model} == test_* ]] || [[ ${model} == *_generated ]]; then
|
||||||
sitl_command="$sitl_bin $no_pxh $src_path/ROMFS/px4fmu_test -s ${src_path}/${rcS_path}/${model} -t $src_path/test_data"
|
sitl_command="$sitl_bin $no_pxh $src_path/ROMFS/px4fmu_test -s ${src_path}/${rcS_path}/${model} -t $src_path/test_data"
|
||||||
else
|
else
|
||||||
sitl_command="$sitl_bin $no_pxh $src_path/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t $src_path/test_data"
|
sitl_command="$sitl_bin $no_pxh $src_path/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t $src_path/test_data"
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ set(tests
|
|||||||
int
|
int
|
||||||
mathlib
|
mathlib
|
||||||
matrix
|
matrix
|
||||||
mavlink
|
|
||||||
microbench_hrt
|
microbench_hrt
|
||||||
microbench_math
|
microbench_math
|
||||||
microbench_matrix
|
microbench_matrix
|
||||||
@@ -45,7 +44,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(test_name ${tests})
|
foreach(test_name ${tests})
|
||||||
configure_file(${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/tests_template.in ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/tests_${test_name}_generated)
|
configure_file(${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_template.in ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_${test_name}_generated)
|
||||||
|
|
||||||
add_test(NAME ${test_name}
|
add_test(NAME ${test_name}
|
||||||
COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh
|
COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh
|
||||||
@@ -53,7 +52,7 @@ foreach(test_name ${tests})
|
|||||||
posix-configs/SITL/init/test
|
posix-configs/SITL/init/test
|
||||||
none
|
none
|
||||||
none
|
none
|
||||||
tests_${test_name}_generated
|
test_${test_name}_generated
|
||||||
${PX4_SOURCE_DIR}
|
${PX4_SOURCE_DIR}
|
||||||
${PX4_BINARY_DIR}
|
${PX4_BINARY_DIR}
|
||||||
WORKING_DIRECTORY ${SITL_WORKING_DIR})
|
WORKING_DIRECTORY ${SITL_WORKING_DIR})
|
||||||
@@ -62,6 +61,23 @@ foreach(test_name ${tests})
|
|||||||
set_tests_properties(${test_name} PROPERTIES PASS_REGULAR_EXPRESSION "${test_name} PASSED")
|
set_tests_properties(${test_name} PROPERTIES PASS_REGULAR_EXPRESSION "${test_name} PASSED")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
|
# Mavlink test requires mavlink running
|
||||||
|
add_test(NAME mavlink
|
||||||
|
COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh
|
||||||
|
$<TARGET_FILE:px4>
|
||||||
|
posix-configs/SITL/init/test
|
||||||
|
none
|
||||||
|
none
|
||||||
|
test_mavlink
|
||||||
|
${PX4_SOURCE_DIR}
|
||||||
|
${PX4_BINARY_DIR}
|
||||||
|
WORKING_DIRECTORY ${SITL_WORKING_DIR})
|
||||||
|
|
||||||
|
set_tests_properties(mavlink PROPERTIES FAIL_REGULAR_EXPRESSION "mavlink FAILED")
|
||||||
|
set_tests_properties(mavlink PROPERTIES PASS_REGULAR_EXPRESSION "mavlink PASSED")
|
||||||
|
|
||||||
|
|
||||||
# run arbitrary commands
|
# run arbitrary commands
|
||||||
set(test_cmds
|
set(test_cmds
|
||||||
hello
|
hello
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ ver all
|
|||||||
mavlink start -x -u 14556 -r 2000000
|
mavlink start -x -u 14556 -r 2000000
|
||||||
mavlink boot_complete
|
mavlink boot_complete
|
||||||
|
|
||||||
tests @test_name@
|
tests mavlink
|
||||||
|
|
||||||
dataman status
|
dataman status
|
||||||
|
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# PX4 commands need the 'px4-' prefix in bash.
|
||||||
|
# (px4-alias.sh is expected to be in the PATH)
|
||||||
|
source px4-alias.sh
|
||||||
|
|
||||||
|
uorb start
|
||||||
|
|
||||||
|
param load
|
||||||
|
param set SYS_RESTART_TYPE 0
|
||||||
|
|
||||||
|
dataman start
|
||||||
|
|
||||||
|
simulator start -t
|
||||||
|
tone_alarm start
|
||||||
|
gyrosim start
|
||||||
|
accelsim start
|
||||||
|
barosim start
|
||||||
|
gpssim start
|
||||||
|
measairspeedsim start
|
||||||
|
pwm_out_sim start
|
||||||
|
|
||||||
|
ver all
|
||||||
|
|
||||||
|
tests @test_name@
|
||||||
|
|
||||||
|
dataman status
|
||||||
|
|
||||||
|
shutdown
|
||||||
Reference in New Issue
Block a user