Skip to content

Commit

Permalink
autotest: add autotest for RunMission script
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jul 29, 2023
1 parent 36a225f commit 550f95f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
14 changes: 14 additions & 0 deletions Tools/autotest/arduplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

from pymavlink.rotmat import Vector3
from pysim import vehicleinfo
from pysim import util

import operator

Expand Down Expand Up @@ -4623,6 +4624,18 @@ def AirspeedCal(self):

self.reboot_sitl()

def RunMissionScript(self):
'''Test run_mission.py script'''
script = os.path.join('Tools', 'autotest', 'run_mission.py')
self.stop_SITL()
util.run_cmd([
util.reltopdir(script),
self.binary,
'plane',
self.generic_mission_filepath_for_filename("flaps.txt"),
])
self.start_SITL()

def tests(self):
'''return list of all tests'''
ret = super(AutoTestPlane, self).tests()
Expand Down Expand Up @@ -4702,6 +4715,7 @@ def tests(self):
self.EmbeddedParamParser,
self.AerobaticsScripting,
self.MANUAL_CONTROL,
self.RunMissionScript,
self.WindEstimates,
self.AltResetBadGPS,
self.AirspeedCal,
Expand Down
5 changes: 4 additions & 1 deletion Tools/autotest/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4518,9 +4518,12 @@ def load_rally(self, filename):
def load_sample_mission(self):
self.load_mission(self.sample_mission_filename())

def generic_mission_filepath_for_filename(self, filename):
return os.path.join(testdir, "Generic_Missions", filename)

def load_generic_mission(self, filename, strict=True):
return self.load_mission_from_filepath(
os.path.join(testdir, "Generic_Missions", filename),
self.generic_mission_filepath_for_filename(filename),
strict=strict)

def load_mission(self, filename, strict=True):
Expand Down

0 comments on commit 550f95f

Please sign in to comment.