mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
Tools: add --exclude-board=glob to size_compare_branches.py
This commit is contained in:
parent
4d03327470
commit
38693c0e5d
@ -17,6 +17,7 @@ Output is placed into ../ELF_DIFF_[VEHICLE_NAME]
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
import fnmatch
|
||||||
import optparse
|
import optparse
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
@ -56,6 +57,7 @@ class SizeCompareBranches(object):
|
|||||||
bin_dir=None,
|
bin_dir=None,
|
||||||
run_elf_diff=True,
|
run_elf_diff=True,
|
||||||
all_vehicles=False,
|
all_vehicles=False,
|
||||||
|
exclude_board_glob=[],
|
||||||
all_boards=False,
|
all_boards=False,
|
||||||
use_merge_base=True,
|
use_merge_base=True,
|
||||||
waf_consistent_builds=True,
|
waf_consistent_builds=True,
|
||||||
@ -125,6 +127,15 @@ class SizeCompareBranches(object):
|
|||||||
if v not in self.vehicle_map.keys():
|
if v not in self.vehicle_map.keys():
|
||||||
raise ValueError("Bad vehicle (%s); choose from %s" % (v, ",".join(self.vehicle_map.keys())))
|
raise ValueError("Bad vehicle (%s); choose from %s" % (v, ",".join(self.vehicle_map.keys())))
|
||||||
|
|
||||||
|
# remove boards based on --exclude-board-glob
|
||||||
|
new_self_board = []
|
||||||
|
for exclude_glob in exclude_board_glob:
|
||||||
|
for board_name in self.board:
|
||||||
|
if fnmatch.fnmatch(board_name, exclude_glob):
|
||||||
|
continue
|
||||||
|
new_self_board.append(board_name)
|
||||||
|
self.board = new_self_board
|
||||||
|
|
||||||
# some boards we don't have a -bl.dat for, so skip them.
|
# some boards we don't have a -bl.dat for, so skip them.
|
||||||
# TODO: find a way to get this information from board_list:
|
# TODO: find a way to get this information from board_list:
|
||||||
self.bootloader_blacklist = set([
|
self.bootloader_blacklist = set([
|
||||||
@ -759,6 +770,11 @@ if __name__ == '__main__':
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
help="Build all boards")
|
help="Build all boards")
|
||||||
|
parser.add_option("",
|
||||||
|
"--exclude-board-glob",
|
||||||
|
default=[],
|
||||||
|
action="append",
|
||||||
|
help="exclude any board which matches this pattern")
|
||||||
parser.add_option("",
|
parser.add_option("",
|
||||||
"--all-vehicles",
|
"--all-vehicles",
|
||||||
action='store_true',
|
action='store_true',
|
||||||
@ -799,6 +815,7 @@ if __name__ == '__main__':
|
|||||||
run_elf_diff=(cmd_opts.elf_diff),
|
run_elf_diff=(cmd_opts.elf_diff),
|
||||||
all_vehicles=cmd_opts.all_vehicles,
|
all_vehicles=cmd_opts.all_vehicles,
|
||||||
all_boards=cmd_opts.all_boards,
|
all_boards=cmd_opts.all_boards,
|
||||||
|
exclude_board_glob=cmd_opts.exclude_board_glob,
|
||||||
use_merge_base=not cmd_opts.no_merge_base,
|
use_merge_base=not cmd_opts.no_merge_base,
|
||||||
waf_consistent_builds=not cmd_opts.no_waf_consistent_builds,
|
waf_consistent_builds=not cmd_opts.no_waf_consistent_builds,
|
||||||
show_empty=cmd_opts.show_empty,
|
show_empty=cmd_opts.show_empty,
|
||||||
|
Loading…
Reference in New Issue
Block a user