From b0cb29ed824a41c924e7adce2f150b55d6a98292 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 2 Jan 2020 11:24:14 +0100 Subject: [PATCH] MAVSDK tests: Add minimal plane example This will add coverage for baseline plane controllers. --- test/mavsdk_tests/CMakeLists.txt | 1 + test/mavsdk_tests/mavsdk_test_runner.py | 9 +++++-- .../mavsdk_tests/test_mission_multicopter.cpp | 4 ++-- test/mavsdk_tests/test_mission_plane.cpp | 24 +++++++++++++++++++ 4 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 test/mavsdk_tests/test_mission_plane.cpp diff --git a/test/mavsdk_tests/CMakeLists.txt b/test/mavsdk_tests/CMakeLists.txt index 695cae2ed4..0476682b58 100644 --- a/test/mavsdk_tests/CMakeLists.txt +++ b/test/mavsdk_tests/CMakeLists.txt @@ -13,6 +13,7 @@ if(MAVSDK_FOUND) test_main.cpp autopilot_tester.cpp test_mission_multicopter.cpp + test_mission_plane.cpp ) target_link_libraries(mavsdk_tests diff --git a/test/mavsdk_tests/mavsdk_test_runner.py b/test/mavsdk_tests/mavsdk_test_runner.py index 9478273016..ef14c755f8 100755 --- a/test/mavsdk_tests/mavsdk_test_runner.py +++ b/test/mavsdk_tests/mavsdk_test_runner.py @@ -14,12 +14,17 @@ test_matrix = [ { "model": "iris", "test_filter": "[multicopter]", - "timeout_min": 10, + "timeout_min": 20, }, { "model": "standard_vtol", "test_filter": "[vtol]", - "timeout_min": 10, + "timeout_min": 20, + }, + { + "model": "standard_plane", + "test_filter": "[plane]", + "timeout_min": 25, } ] diff --git a/test/mavsdk_tests/test_mission_multicopter.cpp b/test/mavsdk_tests/test_mission_multicopter.cpp index 8f37db0e82..82b1a57a6f 100644 --- a/test/mavsdk_tests/test_mission_multicopter.cpp +++ b/test/mavsdk_tests/test_mission_multicopter.cpp @@ -11,7 +11,7 @@ #include "autopilot_tester.h" -TEST_CASE("Takeoff and land", "[multicopter][vtol]") +TEST_CASE("Takeoff and Land (Multicopter)", "[multicopter][vtol]") { AutopilotTester tester; tester.connect(connection_url); @@ -23,7 +23,7 @@ TEST_CASE("Takeoff and land", "[multicopter][vtol]") tester.wait_until_disarmed(); } -TEST_CASE("Fly square missions", "[multicopter][vtol]") +TEST_CASE("Fly square Multicopter Missions", "[multicopter][vtol]") { AutopilotTester tester; tester.connect(connection_url); diff --git a/test/mavsdk_tests/test_mission_plane.cpp b/test/mavsdk_tests/test_mission_plane.cpp new file mode 100644 index 0000000000..a683eab1bb --- /dev/null +++ b/test/mavsdk_tests/test_mission_plane.cpp @@ -0,0 +1,24 @@ +// +// Multicopter mission test. +// +// Author: Julian Oes + +#include +#include +#include +#include +#include +#include "autopilot_tester.h" + + +TEST_CASE("Takeoff and land (Plane)", "[plane]") +{ + AutopilotTester tester; + tester.connect(connection_url); + tester.wait_until_ready(); + tester.arm(); + tester.takeoff(); + tester.wait_until_hovering(); + tester.land(); + tester.wait_until_disarmed(); +}