Skip to content
Snippets Groups Projects
Commit 8ddb9997 authored by Daniel Agar's avatar Daniel Agar
Browse files

tests template skip mavlink except for mavlink test

parent 844671ed
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,7 @@ pushd "$rootfs" >/dev/null
# Do not exit on failure now from here on because we want the complete cleanup
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"
else
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
mathlib
matrix
mavlink
microbench_hrt
microbench_math
microbench_matrix
......@@ -45,7 +44,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()
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}
COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh
......@@ -53,7 +52,7 @@ foreach(test_name ${tests})
posix-configs/SITL/init/test
none
none
tests_${test_name}_generated
test_${test_name}_generated
${PX4_SOURCE_DIR}
${PX4_BINARY_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")
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
set(test_cmds
hello
......
......@@ -24,7 +24,7 @@ ver all
mavlink start -x -u 14556 -r 2000000
mavlink boot_complete
tests @test_name@
tests mavlink
dataman status
......
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment