autotest: add --board option to test_build_options.py

Also change to DevEBox as default build target as the BeastHyv2 sprouted a baro
This commit is contained in:
Peter Barker 2022-07-19 22:33:01 +10:00 committed by Peter Barker
parent 8d833e8f23
commit e9507fc47d
1 changed files with 9 additions and 2 deletions

View File

@ -22,7 +22,8 @@ class TestBuildOptions(object):
do_step_disable_none=False, do_step_disable_none=False,
do_step_disable_defaults=True, do_step_disable_defaults=True,
do_step_disable_in_turn=True, do_step_disable_in_turn=True,
build_targets=None): build_targets=None,
board="DevEBoxH7v2"):
self.sizes_nothing_disabled = None self.sizes_nothing_disabled = None
self.match_glob = match_glob self.match_glob = match_glob
self.do_step_disable_all = do_step_disable_all self.do_step_disable_all = do_step_disable_all
@ -32,6 +33,7 @@ class TestBuildOptions(object):
self.build_targets = build_targets self.build_targets = build_targets
if self.build_targets is None: if self.build_targets is None:
self.build_targets = self.all_targets() self.build_targets = self.all_targets()
self._board = board
@staticmethod @staticmethod
def all_targets(): def all_targets():
@ -87,7 +89,7 @@ class TestBuildOptions(object):
def board(self): def board(self):
'''returns board to build for''' '''returns board to build for'''
return "BeastH7v2" return self._board
def test_compile_with_defines(self, defines): def test_compile_with_defines(self, defines):
extra_hwdef_filepath = "/tmp/extra.hwdef" extra_hwdef_filepath = "/tmp/extra.hwdef"
@ -202,6 +204,10 @@ if __name__ == '__main__':
choices=TestBuildOptions.all_targets(), choices=TestBuildOptions.all_targets(),
action='append', action='append',
help='vehicle targets to build') help='vehicle targets to build')
parser.add_option("--board",
type='string',
default="DevEBoxH7v2",
help='board to build for')
opts, args = parser.parse_args() opts, args = parser.parse_args()
@ -212,5 +218,6 @@ if __name__ == '__main__':
do_step_disable_defaults=not opts.no_run_with_defaults, do_step_disable_defaults=not opts.no_run_with_defaults,
do_step_disable_in_turn=not opts.no_disable_in_turn, do_step_disable_in_turn=not opts.no_disable_in_turn,
build_targets=opts.build_targets, build_targets=opts.build_targets,
board=opts.board,
) )
tbo.run() tbo.run()