Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve integration tests file and test names #460

Merged
merged 5 commits into from
Jul 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions external_example/integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
51 changes: 27 additions & 24 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static void takeoff(std::shared_ptr<Action> action, std::shared_ptr<Telemetry> t
static void takeoff_and_transition_to_fixedwing();
static void land_and_disarm(std::shared_ptr<Action> action, std::shared_ptr<Telemetry> telemetry);

TEST_F(SitlTest, ActionSimpleTransition)
TEST_F(SitlTest, ActionTransitionSync)
{
takeoff_and_transition_to_fixedwing();
}
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/calibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -37,7 +37,7 @@ TEST(HardwareTest, GyroCalibration)
}
}

TEST(HardwareTest, AccelerometerCalibration)
TEST(HardwareTest, CalibrationAccelerometer)
{
DronecodeSDK dc;

Expand All @@ -61,7 +61,7 @@ TEST(HardwareTest, AccelerometerCalibration)
}
}

TEST(HardwareTest, MagnetometerCalibration)
TEST(HardwareTest, CalibrationMagnetometer)
{
DronecodeSDK dc;

Expand All @@ -85,7 +85,7 @@ TEST(HardwareTest, MagnetometerCalibration)
}
}

TEST(HardwareTest, GimbalAccelerometerCalibration)
TEST(HardwareTest, CalibrationGimbalAccelerometer)
{
DronecodeSDK dc;

Expand Down
2 changes: 1 addition & 1 deletion integration_tests/camera_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

using namespace dronecode_sdk;

TEST(CameraTest, SetMode)
TEST(CameraTest, SetModeSync)
{
DronecodeSDK dc;

Expand Down
4 changes: 2 additions & 2 deletions integration_tests/camera_take_photo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ static void receive_capture_info(Camera::CaptureInfo capture_info);
static std::atomic<bool> _received_result{false};
static std::atomic<bool> _received_capture_info{false};

TEST(CameraTest, TakePhoto)
TEST(CameraTest, TakePhotoSingle)
{
DronecodeSDK dc;

Expand Down Expand Up @@ -47,7 +47,7 @@ TEST(CameraTest, TakePhoto)
EXPECT_TRUE(_received_capture_info);
}

TEST(CameraTest, TakeMultiplePhotos)
TEST(CameraTest, TakePhotosMultiple)
{
DronecodeSDK dc;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using namespace dronecode_sdk;

TEST_F(SitlTest, TelemetrySimple)
TEST_F(SitlTest, TelemetrySync)
{
DronecodeSDK dc;

Expand Down