Skip to content

Commit

Permalink
tools: rename start/stop SITL scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
julianoes committed Mar 15, 2022
1 parent f558e30 commit 07c3934
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ add_test(integration_tests
add_custom_command(TARGET integration_tests_runner
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/../../tools/start_px4_sitl.sh
${CMAKE_CURRENT_SOURCE_DIR}/../../tools/start_sitl.sh
${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET integration_tests_runner
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/../../tools/stop_px4_sitl.sh
${CMAKE_CURRENT_SOURCE_DIR}/../../tools/stop_sitl.sh
${CMAKE_CURRENT_BINARY_DIR}
)
16 changes: 8 additions & 8 deletions src/integration_tests/integration_test_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

class SitlTest : public testing::Test {
protected:
void StartPX4(const std::string& model)
void StartSitl(const std::string& model)
{
#ifndef WINDOWS
const int ret = system((std::string("./tools/start_px4_sitl.sh ") + model).c_str());
const int ret = system((std::string("./tools/start_sitl.sh ") + model).c_str());
if (ret != 0) {
mavsdk::LogErr() << "./tools/start_px4_sitl.sh failed, giving up.";
mavsdk::LogErr() << "./tools/start_sitl.sh failed, giving up.";
fflush(stdout);
fflush(stderr);
abort();
Expand All @@ -29,12 +29,12 @@ class SitlTest : public testing::Test {
#endif
}

void StopPX4()
void StopSitl()
{
#ifndef WINDOWS
const int ret = system("./tools/stop_px4_sitl.sh");
const int ret = system("./tools/stop_sitl.sh");
if (ret != 0) {
mavsdk::LogErr() << "./tools/stop_px4_sitl.sh failed, giving up.";
mavsdk::LogErr() << "./tools/stop_sitl.sh failed, giving up.";
fflush(stdout);
fflush(stderr);
abort();
Expand All @@ -44,9 +44,9 @@ class SitlTest : public testing::Test {
#endif
}

virtual void SetUp() override { StartPX4(determineModel()); }
virtual void SetUp() override { StartSitl(determineModel()); }

virtual void TearDown() override { StopPX4(); }
virtual void TearDown() override { StopSitl(); }

private:
static std::string determineModel()
Expand Down
4 changes: 2 additions & 2 deletions tools/start_px4_sitl.sh → tools/start_sitl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [[ "${PX4_VERSION}" ]]; then
fi

# Make sure everything is stopped first.
${script_dir}/stop_px4_sitl.sh
${script_dir}/stop_sitl.sh

# To prevent any races.
sleep 1
Expand Down Expand Up @@ -95,7 +95,7 @@ elif [[ "${APM_VERSION}" ]]; then
fi
echo "DEBUG: APM_FIRMWARE_DIR: " ${APM_FIRMWARE_DIR}
# Make sure everything is stopped first.
${script_dir}/stop_px4_sitl.sh
${script_dir}/stop_sitl.sh
echo "DEBUG: script_dir: " ${script_dir}
# To prevent any races.
sleep 1
Expand Down
File renamed without changes.

0 comments on commit 07c3934

Please sign in to comment.