diff --git a/external_example/integration_tests/CMakeLists.txt b/external_example/integration_tests/CMakeLists.txt index 2fe62505cd..7528e1c7cd 100644 --- a/external_example/integration_tests/CMakeLists.txt +++ b/external_example/integration_tests/CMakeLists.txt @@ -1,11 +1,16 @@ +cmake_minimum_required(VERSION 3.1) + add_executable(external_example_integration_tests_runner - ${PROJECT_SOURCE_DIR}/core/unittests_main.cpp + ../../core/unittests_main.cpp hello_world.cpp ) include_directories( - ${PROJECT_SOURCE_DIR}/core - ${PROJECT_SOURCE_DIR}/external_example + ../../core + ../../integration_tests + ../../external_example + ../../third_party/gtest/googletest/include + ../../third_party/gtest/googlemock/include ) target_link_libraries(external_example_integration_tests_runner diff --git a/integration_tests/CMakeLists.txt b/integration_tests/CMakeLists.txt index 6eff5eae93..2cf12ad120 100644 --- a/integration_tests/CMakeLists.txt +++ b/integration_tests/CMakeLists.txt @@ -13,34 +13,37 @@ add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --verbose) # This includes all GTests that run integration tests add_executable(integration_tests_runner ../core/unittests_main.cpp - simple_connect.cpp - async_connect.cpp - telemetry_simple.cpp - telemetry_async.cpp - telemetry_modes.cpp - telemetry_health.cpp - simple_hover.cpp - async_hover.cpp - takeoff_and_kill.cpp - offboard_velocity.cpp - logging.cpp - info.cpp - mission.cpp - mission_change_speed.cpp - mission_survey.cpp - rtl.cpp - gimbal.cpp - transition_multicopter_fixedwing.cpp - follow_me.cpp - multi_components.cpp + action_hover_async.cpp + action_hover_sync.cpp + action_takeoff_and_kill.cpp + action_transition_multicopter_fixedwing.cpp calibration.cpp - path_checker.cpp - camera_take_photo.cpp - camera_take_photo_interval.cpp camera_mode.cpp + camera_settings.cpp camera_status.cpp + camera_take_photo.cpp + camera_take_photo_interval.cpp camera_test_helpers.cpp - camera_settings.cpp + camera_test_helpers.h + CMakeLists.txt + follow_me.cpp + gimbal.cpp + info.cpp + logging.cpp + mission_change_speed.cpp + mission.cpp + mission_rtl.cpp + mission_survey.cpp + offboard_velocity.cpp + path_checker.cpp + path_checker.h + system_connection_async.cpp + system_connection_sync.cpp + system_multi_components.cpp + telemetry_async.cpp + telemetry_health.cpp + telemetry_modes.cpp + telemetry_sync.cpp ) include_directories( diff --git a/integration_tests/async_hover.cpp b/integration_tests/action_hover_async.cpp similarity index 98% rename from integration_tests/async_hover.cpp rename to integration_tests/action_hover_async.cpp index 690ba4e85b..ba00bd906b 100644 --- a/integration_tests/async_hover.cpp +++ b/integration_tests/action_hover_async.cpp @@ -15,7 +15,7 @@ void receive_in_air(bool in_air); static bool _all_ok = false; static bool _in_air = false; -TEST_F(SitlTest, ActionAsyncHover) +TEST_F(SitlTest, ActionHoverAsync) { DronecodeSDK dc; diff --git a/integration_tests/simple_hover.cpp b/integration_tests/action_hover_sync.cpp similarity index 94% rename from integration_tests/simple_hover.cpp rename to integration_tests/action_hover_sync.cpp index 1ff5ec29f9..f35196f82d 100644 --- a/integration_tests/simple_hover.cpp +++ b/integration_tests/action_hover_sync.cpp @@ -9,17 +9,17 @@ using namespace dronecode_sdk; static void takeoff_and_hover_at_altitude(float altitude_m = NAN); -TEST_F(SitlTest, ActionSimpleHoverDefault) +TEST_F(SitlTest, ActionHoverSyncDefault) { takeoff_and_hover_at_altitude(); } -TEST_F(SitlTest, ActionSimpleHoverHigher) +TEST_F(SitlTest, ActionHoverSyncHigher) { takeoff_and_hover_at_altitude(5.0f); } -TEST_F(SitlTest, ActionSimpleHoverLower) +TEST_F(SitlTest, ActionHoverSyncLower) { takeoff_and_hover_at_altitude(1.0f); } diff --git a/integration_tests/takeoff_and_kill.cpp b/integration_tests/action_takeoff_and_kill.cpp similarity index 100% rename from integration_tests/takeoff_and_kill.cpp rename to integration_tests/action_takeoff_and_kill.cpp diff --git a/integration_tests/transition_multicopter_fixedwing.cpp b/integration_tests/action_transition_multicopter_fixedwing.cpp similarity index 98% rename from integration_tests/transition_multicopter_fixedwing.cpp rename to integration_tests/action_transition_multicopter_fixedwing.cpp index a3c9718974..7a37927430 100644 --- a/integration_tests/transition_multicopter_fixedwing.cpp +++ b/integration_tests/action_transition_multicopter_fixedwing.cpp @@ -11,7 +11,7 @@ static void takeoff(std::shared_ptr action, std::shared_ptr t static void takeoff_and_transition_to_fixedwing(); static void land_and_disarm(std::shared_ptr action, std::shared_ptr telemetry); -TEST_F(SitlTest, ActionSimpleTransition) +TEST_F(SitlTest, ActionTransitionSync) { takeoff_and_transition_to_fixedwing(); } diff --git a/integration_tests/calibration.cpp b/integration_tests/calibration.cpp index 8f204f0134..5b0164d2dd 100644 --- a/integration_tests/calibration.cpp +++ b/integration_tests/calibration.cpp @@ -13,7 +13,7 @@ static void receive_calibration_callback(Calibration::Result result, const std::string calibration_type, bool &done); -TEST(HardwareTest, GyroCalibration) +TEST(HardwareTest, CalibrationGyro) { DronecodeSDK dc; @@ -37,7 +37,7 @@ TEST(HardwareTest, GyroCalibration) } } -TEST(HardwareTest, AccelerometerCalibration) +TEST(HardwareTest, CalibrationAccelerometer) { DronecodeSDK dc; @@ -61,7 +61,7 @@ TEST(HardwareTest, AccelerometerCalibration) } } -TEST(HardwareTest, MagnetometerCalibration) +TEST(HardwareTest, CalibrationMagnetometer) { DronecodeSDK dc; @@ -85,7 +85,7 @@ TEST(HardwareTest, MagnetometerCalibration) } } -TEST(HardwareTest, GimbalAccelerometerCalibration) +TEST(HardwareTest, CalibrationGimbalAccelerometer) { DronecodeSDK dc; diff --git a/integration_tests/camera_mode.cpp b/integration_tests/camera_mode.cpp index a9683ccf74..5f81fb1411 100644 --- a/integration_tests/camera_mode.cpp +++ b/integration_tests/camera_mode.cpp @@ -8,7 +8,7 @@ using namespace dronecode_sdk; -TEST(CameraTest, SetMode) +TEST(CameraTest, SetModeSync) { DronecodeSDK dc; diff --git a/integration_tests/camera_take_photo.cpp b/integration_tests/camera_take_photo.cpp index a1a6428ba0..a730d44727 100644 --- a/integration_tests/camera_take_photo.cpp +++ b/integration_tests/camera_take_photo.cpp @@ -19,7 +19,7 @@ static void receive_capture_info(Camera::CaptureInfo capture_info); static std::atomic _received_result{false}; static std::atomic _received_capture_info{false}; -TEST(CameraTest, TakePhoto) +TEST(CameraTest, TakePhotoSingle) { DronecodeSDK dc; @@ -47,7 +47,7 @@ TEST(CameraTest, TakePhoto) EXPECT_TRUE(_received_capture_info); } -TEST(CameraTest, TakeMultiplePhotos) +TEST(CameraTest, TakePhotosMultiple) { DronecodeSDK dc; diff --git a/core/integration_test_helper.h b/integration_tests/integration_test_helper.h similarity index 100% rename from core/integration_test_helper.h rename to integration_tests/integration_test_helper.h diff --git a/integration_tests/rtl.cpp b/integration_tests/mission_rtl.cpp similarity index 97% rename from integration_tests/rtl.cpp rename to integration_tests/mission_rtl.cpp index e926b868bd..9214676861 100644 --- a/integration_tests/rtl.cpp +++ b/integration_tests/mission_rtl.cpp @@ -18,17 +18,17 @@ using namespace std::placeholders; // for `_1` void do_mission_with_rtl(float mission_altitude_m, float rtl_altitude_m); -TEST_F(SitlTest, RTLHigh) +TEST_F(SitlTest, MissionWithRTLHigh) { do_mission_with_rtl(20, 30); } -TEST_F(SitlTest, RTLLow) +TEST_F(SitlTest, MissionWithRTLLow) { do_mission_with_rtl(5, 10); } -TEST_F(SitlTest, RTLHigherAnyway) +TEST_F(SitlTest, MissionWithRTLHigherAnyway) { do_mission_with_rtl(10, 5); } diff --git a/integration_tests/async_connect.cpp b/integration_tests/system_connection_async.cpp similarity index 97% rename from integration_tests/async_connect.cpp rename to integration_tests/system_connection_async.cpp index d609b966ec..75d96ad0d7 100644 --- a/integration_tests/async_connect.cpp +++ b/integration_tests/system_connection_async.cpp @@ -13,7 +13,7 @@ static uint64_t _uuid = 0; void on_discover(uint64_t uuid); void on_timeout(uint64_t uuid); -TEST_F(SitlTest, AsyncConnect) +TEST_F(SitlTest, SystemConnectionAsync) { DronecodeSDK dc; diff --git a/integration_tests/simple_connect.cpp b/integration_tests/system_connection_sync.cpp similarity index 96% rename from integration_tests/simple_connect.cpp rename to integration_tests/system_connection_sync.cpp index c9259ea95b..0aa241c036 100644 --- a/integration_tests/simple_connect.cpp +++ b/integration_tests/system_connection_sync.cpp @@ -5,7 +5,7 @@ using namespace dronecode_sdk; -TEST_F(SitlTest, TwoConnections) +TEST_F(SitlTest, SystemConnectionMultiple) { dronecode_sdk::DronecodeSDK *dc; dc = new dronecode_sdk::DronecodeSDK(); diff --git a/integration_tests/multi_components.cpp b/integration_tests/system_multi_components.cpp similarity index 95% rename from integration_tests/multi_components.cpp rename to integration_tests/system_multi_components.cpp index 8910329ba7..6b82071d6d 100644 --- a/integration_tests/multi_components.cpp +++ b/integration_tests/system_multi_components.cpp @@ -20,10 +20,10 @@ using namespace std::chrono; * 1. Connect a V4L2 Camera on Ubuntu. * 2. Launch Camera Streaming Daemon on Ubuntu and configure UDP port 14550. * 3. Launch PX4 SITL. - * 4. Run SitlTest.MultiComponentDiscovery test. + * 4. Run SitlTest.SystemMultipleComponents test. * ///////////////////////////////////// */ -TEST_F(SitlTest, MultiComponentDiscovery) +TEST_F(SitlTest, SystemMultipleComponents) { DronecodeSDK dc; diff --git a/integration_tests/telemetry_simple.cpp b/integration_tests/telemetry_sync.cpp similarity index 99% rename from integration_tests/telemetry_simple.cpp rename to integration_tests/telemetry_sync.cpp index aa1abdd0f1..c51e398aa8 100644 --- a/integration_tests/telemetry_simple.cpp +++ b/integration_tests/telemetry_sync.cpp @@ -5,7 +5,7 @@ using namespace dronecode_sdk; -TEST_F(SitlTest, TelemetrySimple) +TEST_F(SitlTest, TelemetrySync) { DronecodeSDK dc;