From 73884312da69a607e48ea8b5d4e70a047882226b Mon Sep 17 00:00:00 2001 From: Ramon Roche Date: Fri, 13 Mar 2026 09:41:03 -0700 Subject: [PATCH] fix(mavlink): remove all stale mavlink_tests references The mavlink_tests module was deleted in 1009268d311 but several references were left behind, breaking builds on all targets. Removed: - CMakeLists.txt: add_subdirectory(mavlink_tests) - mavlink_ftp.cpp: #include of deleted mavlink_ftp_test.h - mavlink_ftp.h: MavlinkFtpTest forward decl and friend class - posix-configs/SITL/init/test/test_mavlink: dead init script - sitl_tests.cmake: sitl-mavlink CTest target - install-voxl.sh: px4-mavlink_tests symlink Ref: https://github.com/PX4/PX4-Autopilot/issues/26738 Signed-off-by: Ramon Roche --- boards/modalai/voxl2/scripts/install-voxl.sh | 1 - platforms/posix/cmake/sitl_tests.cmake | 14 ------------ posix-configs/SITL/init/test/test_mavlink | 23 -------------------- src/modules/mavlink/CMakeLists.txt | 4 ---- src/modules/mavlink/mavlink_ftp.cpp | 2 -- src/modules/mavlink/mavlink_ftp.h | 4 ---- 6 files changed, 48 deletions(-) delete mode 100644 posix-configs/SITL/init/test/test_mavlink diff --git a/boards/modalai/voxl2/scripts/install-voxl.sh b/boards/modalai/voxl2/scripts/install-voxl.sh index 88112d61ea..e4ae8675eb 100755 --- a/boards/modalai/voxl2/scripts/install-voxl.sh +++ b/boards/modalai/voxl2/scripts/install-voxl.sh @@ -65,7 +65,6 @@ adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-logger" adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-manual_control" adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mavlink" adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mavlink_bridge" -adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mavlink_tests" adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mb12xx" adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mc_att_control" adb shell "cd /usr/bin; /bin/ln -f -s px4 px4-mc_pos_control" diff --git a/platforms/posix/cmake/sitl_tests.cmake b/platforms/posix/cmake/sitl_tests.cmake index fdd8a5300e..01dc680aa6 100644 --- a/platforms/posix/cmake/sitl_tests.cmake +++ b/platforms/posix/cmake/sitl_tests.cmake @@ -72,20 +72,6 @@ endforeach() -# Mavlink test requires mavlink running -add_test(NAME sitl-mavlink - COMMAND $ - -s ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_mavlink - -t ${PX4_SOURCE_DIR}/test_data - ${PX4_SOURCE_DIR}/ROMFS/px4fmu_test - WORKING_DIRECTORY ${SITL_WORKING_DIR} -) - -set_tests_properties(sitl-mavlink PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL") -set_tests_properties(sitl-mavlink PROPERTIES PASS_REGULAR_EXPRESSION "ALL TESTS PASSED") -sanitizer_fail_test_on_error(sitl-mavlink) - - # IMU filtering add_test(NAME sitl-imu_filtering COMMAND $ diff --git a/posix-configs/SITL/init/test/test_mavlink b/posix-configs/SITL/init/test/test_mavlink deleted file mode 100644 index 57afc0ca5e..0000000000 --- a/posix-configs/SITL/init/test/test_mavlink +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# PX4 commands need the 'px4-' prefix in bash. -# (px4-alias.sh is expected to be in the PATH) -. px4-alias.sh - -param load -param set CBRK_SUPPLY_CHK 894281 - -dataman start - -battery_simulator start -simulator_mavlink start -tone_alarm start -pwm_out_sim start - -ver all - -mavlink start -x -u 14556 -r 2000000 -mavlink boot_complete - -mavlink_tests - -shutdown diff --git a/src/modules/mavlink/CMakeLists.txt b/src/modules/mavlink/CMakeLists.txt index 79cd271c28..8f7c696d8b 100644 --- a/src/modules/mavlink/CMakeLists.txt +++ b/src/modules/mavlink/CMakeLists.txt @@ -145,10 +145,6 @@ px4_add_module( UNITY_BUILD ) -if(PX4_TESTING) - add_subdirectory(mavlink_tests) -endif() - px4_add_unit_gtest(SRC MavlinkStatustextHandlerTest.cpp INCLUDES ${MAVLINK_LIBRARY_DIR} diff --git a/src/modules/mavlink/mavlink_ftp.cpp b/src/modules/mavlink/mavlink_ftp.cpp index d470d03554..142c7302dc 100644 --- a/src/modules/mavlink/mavlink_ftp.cpp +++ b/src/modules/mavlink/mavlink_ftp.cpp @@ -43,8 +43,6 @@ #include #include "mavlink_ftp.h" -#include "mavlink_tests/mavlink_ftp_test.h" - #include "mavlink_main.h" using namespace time_literals; diff --git a/src/modules/mavlink/mavlink_ftp.h b/src/modules/mavlink/mavlink_ftp.h index e7bf6c72bd..344a61997f 100644 --- a/src/modules/mavlink/mavlink_ftp.h +++ b/src/modules/mavlink/mavlink_ftp.h @@ -45,7 +45,6 @@ #include "mavlink_bridge_header.h" -class MavlinkFtpTest; class Mavlink; /// MAVLink remote file server. Support FTP like commands using MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL message. @@ -199,8 +198,5 @@ private: uint8_t _last_reply[MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_LEN - MAVLINK_MSG_FILE_TRANSFER_PROTOCOL_FIELD_PAYLOAD_LEN + sizeof(PayloadHeader) + sizeof(uint32_t)]; - // Mavlink test needs to be able to call send - friend class MavlinkFtpTest; - int _our_errno {0}; };