# Use a simple list here, sinc OrderedDict requires Python 2.7
self._boards = []
- def AddBoard(self, board):
+ def AddBoard(self, brd):
"""Add a new board to the list.
The board's target member must not already exist in the board list.
Args:
- board: board to add
+ brd: board to add
"""
- self._boards.append(board)
+ self._boards.append(brd)
def ReadBoards(self, fname):
"""Read a list of boards from a board file.
if len(fields) > 8:
fields = fields[:8]
- board = Board(*fields)
- self.AddBoard(board)
+ brd = Board(*fields)
+ self.AddBoard(brd)
def GetList(self):
value is board
"""
board_dict = OrderedDict()
- for board in self._boards:
- board_dict[board.target] = board
+ for brd in self._boards:
+ board_dict[brd.target] = brd
return board_dict
def GetSelectedDict(self):
List of Board objects that are marked selected
"""
board_dict = OrderedDict()
- for board in self._boards:
- if board.build_it:
- board_dict[board.target] = board
+ for brd in self._boards:
+ if brd.build_it:
+ board_dict[brd.target] = brd
return board_dict
def GetSelected(self):
Returns:
List of Board objects that are marked selected
"""
- return [board for board in self._boards if board.build_it]
+ return [brd for brd in self._boards if brd.build_it]
def GetSelectedNames(self):
"""Return a list of selected boards
Returns:
List of board names that are marked selected
"""
- return [board.target for board in self._boards if board.build_it]
+ return [brd.target for brd in self._boards if brd.build_it]
def _BuildTerms(self, args):
"""Convert command line arguments to a list of terms.
exclude_list.append(Expr(expr))
found = []
- for board in self._boards:
+ for brd in self._boards:
matching_term = None
build_it = False
if terms:
match = False
for term in terms:
- if term.Matches(board.props):
+ if term.Matches(brd.props):
matching_term = str(term)
build_it = True
break
elif boards:
- if board.target in boards:
+ if brd.target in boards:
build_it = True
- found.append(board.target)
+ found.append(brd.target)
else:
build_it = True
# Check that it is not specifically excluded
for expr in exclude_list:
- if expr.Matches(board.props):
+ if expr.Matches(brd.props):
build_it = False
break
if build_it:
- board.build_it = True
+ brd.build_it = True
if matching_term:
- result[matching_term].append(board.target)
- result['all'].append(board.target)
+ result[matching_term].append(brd.target)
+ result['all'].append(brd.target)
if boards:
remaining = set(boards) - set(found)
config = {}
environment = {}
- for board in boards_selected.values():
- outcome = self.GetBuildOutcome(commit_upto, board.target,
+ for brd in boards_selected.values():
+ outcome = self.GetBuildOutcome(commit_upto, brd.target,
read_func_sizes, read_config,
read_environment)
- board_dict[board.target] = outcome
+ board_dict[brd.target] = outcome
last_func = None
last_was_warning = False
for line in outcome.err_lines:
if is_warning or (last_was_warning and is_note):
if last_func:
AddLine(warn_lines_summary, warn_lines_boards,
- last_func, board)
+ last_func, brd)
AddLine(warn_lines_summary, warn_lines_boards,
- line, board)
+ line, brd)
else:
if last_func:
AddLine(err_lines_summary, err_lines_boards,
- last_func, board)
+ last_func, brd)
AddLine(err_lines_summary, err_lines_boards,
- line, board)
+ line, brd)
last_was_warning = is_warning
last_func = None
- tconfig = Config(self.config_filenames, board.target)
+ tconfig = Config(self.config_filenames, brd.target)
for fname in self.config_filenames:
if outcome.config:
for key, value in outcome.config[fname].items():
tconfig.Add(fname, key, value)
- config[board.target] = tconfig
+ config[brd.target] = tconfig
- tenvironment = Environment(board.target)
+ tenvironment = Environment(brd.target)
if outcome.environment:
for key, value in outcome.environment.items():
tenvironment.Add(key, value)
- environment[board.target] = tenvironment
+ environment[brd.target] = tenvironment
return (board_dict, err_lines_summary, err_lines_boards,
warn_lines_summary, warn_lines_boards, config, environment)
board.target
"""
self._base_board_dict = {}
- for board in board_selected:
- self._base_board_dict[board] = Builder.Outcome(0, [], [], {}, {},
- {})
+ for brd in board_selected:
+ self._base_board_dict[brd] = Builder.Outcome(0, [], [], {}, {}, {})
self._base_err_lines = []
self._base_warn_lines = []
self._base_err_line_boards = {}
boards = []
board_set = set()
if self._list_error_boards:
- for board in line_boards[line]:
- if not board in board_set:
- boards.append(board)
- board_set.add(board)
+ for brd in line_boards[line]:
+ if not brd in board_set:
+ boards.append(brd)
+ board_set.add(brd)
return boards
def _CalcErrorDelta(base_lines, base_line_boards, lines, line_boards,
out_list = []
for line in err_lines:
boards = ''
- names = [board.target for board in line.boards]
+ names = [brd.target for brd in line.boards]
board_str = ' '.join(names) if names else ''
if board_str:
out = self.col.build(colour, line.char + '(')
# Get a list of boards that did not get built, if needed
not_built = []
- for board in board_selected:
- if not board in board_dict:
- not_built.append(board)
+ for brd in board_selected:
+ if not brd in board_dict:
+ not_built.append(brd)
if not_built:
tprint("Boards not built (%d): %s" % (len(not_built),
', '.join(not_built)))
# Create jobs to build all commits for each board
for brd in board_selected.values():
job = builderthread.BuilderJob()
- job.board = brd
+ job.brd = brd
job.commits = commits
job.keep_outputs = keep_outputs
job.work_in_output = self.work_in_output
"""Holds information about a job to be performed by a thread
Members:
- board: Board object to build
+ brd: Board object to build
commits: List of Commit objects to build
keep_outputs: True to save build output files
step: 1 to process every commit, n to process every nth commit
don't write to a separate output directory.
"""
def __init__(self):
- self.board = None
+ self.brd = None
self.commits = []
self.keep_outputs = False
self.step = 1
Returns:
List of Result objects
"""
- brd = job.board
+ brd = job.brd
work_dir = self.builder.GetThreadDir(self.thread_num)
self.toolchain = None
if job.commits:
self.assertEqual(ret_code, 100)
for commit in range(self._commits):
- for board in self._boards.GetList():
- if board.arch != 'sandbox':
- errfile = self._builder.GetErrFile(commit, board.target)
+ for brd in self._boards.GetList():
+ if brd.arch != 'sandbox':
+ errfile = self._builder.GetErrFile(commit, brd.target)
fd = open(errfile)
self.assertEqual(fd.readlines(),
- ['No tool chain for %s\n' % board.arch])
+ ['No tool chain for %s\n' % brd.arch])
fd.close()
def testBranch(self):
# TODO(sjg@chromium.org): If plus is '', we shouldn't need this
expect += ' ' + col.build(expected_colour, plus)
expect += ' '
- for board in boards:
- expect += col.build(expected_colour, ' %s' % board)
+ for brd in boards:
+ expect += col.build(expected_colour, ' %s' % brd)
self.assertEqual(text, expect)
def _SetupTest(self, echo_lines=False, threads=1, **kwdisplay_args):
args = args[:m.start(0)] + value + args[m.end(0):]
return args
- def GetMakeArguments(self, board):
+ def GetMakeArguments(self, brd):
"""Returns 'make' arguments for a given board
The flags are in a section called 'make-flags'. Flags are named
A special 'target' variable is set to the board target.
Args:
- board: Board object for the board to check.
+ brd: Board object for the board to check.
Returns:
'make' flags for that board, or '' if none
"""
- self._make_flags['target'] = board.target
+ self._make_flags['target'] = brd.target
arg_str = self.ResolveReferences(self._make_flags,
- self._make_flags.get(board.target, ''))
+ self._make_flags.get(brd.target, ''))
args = re.findall("(?:\".*?\"|\S)+", arg_str)
i = 0
while i < len(args):