autotest: tidy setting of board type
splitting the string isn't pretty - just set two variables.
This commit is contained in:
parent
113ada0524
commit
d4cbb54e35
@ -286,7 +286,7 @@ __bin_names = {
|
|||||||
"Blimp": "blimp",
|
"Blimp": "blimp",
|
||||||
"BalanceBot": "ardurover",
|
"BalanceBot": "ardurover",
|
||||||
"Sailboat": "ardurover",
|
"Sailboat": "ardurover",
|
||||||
"SITLPeriphUniversal": "sitl_periph_universal.AP_Periph",
|
"SITLPeriphUniversal": ("sitl_periph_universal", "AP_Periph"),
|
||||||
"CAN": "arducopter",
|
"CAN": "arducopter",
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,17 +298,16 @@ def binary_path(step, debug=False):
|
|||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
if vehicle in __bin_names:
|
if vehicle not in __bin_names:
|
||||||
if len(__bin_names[vehicle].split(".")) == 2:
|
|
||||||
config_name = __bin_names[vehicle].split(".")[0]
|
|
||||||
binary_name = __bin_names[vehicle].split(".")[1]
|
|
||||||
else:
|
|
||||||
config_name = 'sitl'
|
|
||||||
binary_name = __bin_names[vehicle]
|
|
||||||
else:
|
|
||||||
# cope with builds that don't have a specific binary
|
# cope with builds that don't have a specific binary
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
try:
|
||||||
|
(config_name, binary_name) = __bin_names[vehicle]
|
||||||
|
except ValueError:
|
||||||
|
config_name = "sitl"
|
||||||
|
binary_name = __bin_names[vehicle]
|
||||||
|
|
||||||
binary = util.reltopdir(os.path.join('build',
|
binary = util.reltopdir(os.path.join('build',
|
||||||
config_name,
|
config_name,
|
||||||
'bin',
|
'bin',
|
||||||
@ -420,6 +419,7 @@ def run_step(step):
|
|||||||
build_opts = build_opts
|
build_opts = build_opts
|
||||||
|
|
||||||
vehicle_binary = None
|
vehicle_binary = None
|
||||||
|
board = "sitl"
|
||||||
if step == 'build.Plane':
|
if step == 'build.Plane':
|
||||||
vehicle_binary = 'bin/arduplane'
|
vehicle_binary = 'bin/arduplane'
|
||||||
|
|
||||||
@ -442,7 +442,8 @@ def run_step(step):
|
|||||||
vehicle_binary = 'bin/ardusub'
|
vehicle_binary = 'bin/ardusub'
|
||||||
|
|
||||||
if step == 'build.SITLPeriphUniversal':
|
if step == 'build.SITLPeriphUniversal':
|
||||||
vehicle_binary = 'sitl_periph_universal.bin/AP_Periph'
|
vehicle_binary = 'bin/AP_Periph'
|
||||||
|
board = 'sitl_periph_universal'
|
||||||
|
|
||||||
if step == 'build.Replay':
|
if step == 'build.Replay':
|
||||||
return util.build_replay(board='SITL')
|
return util.build_replay(board='SITL')
|
||||||
@ -453,14 +454,11 @@ def run_step(step):
|
|||||||
os.unlink(binary)
|
os.unlink(binary)
|
||||||
except (FileNotFoundError, ValueError):
|
except (FileNotFoundError, ValueError):
|
||||||
pass
|
pass
|
||||||
if len(vehicle_binary.split(".")) == 1:
|
return util.build_SITL(
|
||||||
return util.build_SITL(vehicle_binary, **build_opts)
|
vehicle_binary,
|
||||||
else:
|
board=board,
|
||||||
return util.build_SITL(
|
**build_opts
|
||||||
vehicle_binary.split(".")[1],
|
)
|
||||||
board=vehicle_binary.split(".")[0],
|
|
||||||
**build_opts
|
|
||||||
)
|
|
||||||
|
|
||||||
binary = binary_path(step, debug=opts.debug)
|
binary = binary_path(step, debug=opts.debug)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user