Skip to content

Commit

Permalink
autotest: stop passing defaults in via --defaults to custom_sitl_comm…
Browse files Browse the repository at this point in the history
…andline
  • Loading branch information
peterbarker committed Apr 18, 2024
1 parent b78b79f commit 61a7460
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions Tools/autotest/arducopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7652,7 +7652,8 @@ def BaroWindCorrection(self):
ex = None
try:
self.customise_SITL_commandline(
["--defaults", ','.join(self.model_defaults_filepath('Callisto'))],
[],
defaults_filepath=self.model_defaults_filepath('Callisto'),
model="octa-quad:@ROMFS/models/Callisto.json",
wipe=True,
)
Expand Down Expand Up @@ -8847,7 +8848,8 @@ def GPSBlending(self):
def Callisto(self):
'''Test Callisto'''
self.customise_SITL_commandline(
["--defaults", ','.join(self.model_defaults_filepath('Callisto')), ],
[],
defaults_filepath=self.model_defaults_filepath('Callisto'),
model="octa-quad:@ROMFS/models/Callisto.json",
wipe=True,
)
Expand Down
3 changes: 2 additions & 1 deletion Tools/autotest/arduplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -3917,7 +3917,8 @@ def FlyEachFrame(self):
if not isinstance(defaults, list):
defaults = [defaults]
self.customise_SITL_commandline(
["--defaults", ','.join(defaults), ],
[],
defaults_filepath=defaults,
model=model,
wipe=True,
)
Expand Down
6 changes: 4 additions & 2 deletions Tools/autotest/helicopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ def FlyEachFrame(self):
if not isinstance(defaults, list):
defaults = [defaults]
self.customise_SITL_commandline(
["--defaults", ','.join(defaults), ],
[],
defaults_filepath=defaults,
model=model,
wipe=True,
)
Expand All @@ -210,7 +211,8 @@ def FlyEachFrame(self):
def governortest(self):
'''Test Heli Internal Throttle Curve and Governor'''
self.customise_SITL_commandline(
["--defaults", ','.join(self.model_defaults_filepath('heli-gas')), ],
[],
defaults_filepath=self.model_defaults_filepath('heli-gas'),
model="heli-gas",
wipe=True,
)
Expand Down
3 changes: 3 additions & 0 deletions Tools/autotest/pysim/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,9 @@ def start_SITL(binary,

cmd.extend(customisations)

if "--defaults" in customisations:
raise ValueError("--defaults must be passed in via defaults_filepath keyword argument, not as part of customisation list") # noqa

pexpect_logfile_prefix = stdout_prefix
if pexpect_logfile_prefix is None:
pexpect_logfile_prefix = os.path.basename(binary)
Expand Down

0 comments on commit 61a7460

Please sign in to comment.