[errors[4]]],
]
-boards = [
+BOARDS = [
['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 1', 'board0', ''],
['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 2', 'board1', ''],
['Active', 'powerpc', 'powerpc', '', 'Tester', 'PowerPC board 1', 'board2', ''],
self.commits.append(comm)
# Set up boards to build
- self.boards = board.Boards()
- for brd in boards:
- self.boards.AddBoard(board.Board(*brd))
- self.boards.SelectBoards([])
+ self.brds = board.Boards()
+ for brd in BOARDS:
+ self.brds.AddBoard(board.Board(*brd))
+ self.brds.SelectBoards([])
# Add some test settings
bsettings.Setup(None)
result.combined = result.stdout + result.stderr
return result
- def assertSummary(self, text, arch, plus, boards, outcome=OUTCOME_ERR):
+ def assertSummary(self, text, arch, plus, brds, outcome=OUTCOME_ERR):
col = self._col
expected_colour = (col.GREEN if outcome == OUTCOME_OK else
col.YELLOW if outcome == OUTCOME_WARN else col.RED)
# TODO(sjg@chromium.org): If plus is '', we shouldn't need this
expect += ' ' + col.build(expected_colour, plus)
expect += ' '
- for brd in boards:
+ for brd in brds:
expect += col.build(expected_colour, ' %s' % brd)
self.assertEqual(text, expect)
build = builder.Builder(self.toolchains, self.base_dir, None, threads,
2, checkout=False, show_unknown=False)
build.do_make = self.Make
- board_selected = self.boards.GetSelectedDict()
+ board_selected = self.brds.GetSelectedDict()
# Build the boards for the pre-defined commits and warnings/errors
# associated with each. This calls our Make() to inject the fake output.
# We should get two starting messages, an update for every commit built
# and a summary message
- self.assertEqual(count, len(commits) * len(boards) + 3)
+ self.assertEqual(count, len(commits) * len(BOARDS) + 3)
build.SetDisplayOptions(**kwdisplay_args);
build.ShowSummary(self.commits, board_selected)
if echo_lines:
filter_dtb_warnings: Adjust the check for output produced with the
--filter-dtb-warnings flag
"""
- def add_line_prefix(prefix, boards, error_str, colour):
+ def add_line_prefix(prefix, brds, error_str, colour):
"""Add a prefix to each line of a string
The training \n in error_str is removed before processing
lines = error_str.strip().splitlines()
new_lines = []
for line in lines:
- if boards:
+ if brds:
expect = self._col.build(colour, prefix + '(')
- expect += self._col.build(self._col.MAGENTA, boards,
+ expect += self._col.build(self._col.MAGENTA, brds,
bright=False)
expect += self._col.build(colour, ') %s' % line)
else:
def testBoardSingle(self):
"""Test single board selection"""
- self.assertEqual(self.boards.SelectBoards(['sandbox']),
+ self.assertEqual(self.brds.SelectBoards(['sandbox']),
({'all': ['board4'], 'sandbox': ['board4']}, []))
def testBoardArch(self):
"""Test single board selection"""
- self.assertEqual(self.boards.SelectBoards(['arm']),
+ self.assertEqual(self.brds.SelectBoards(['arm']),
({'all': ['board0', 'board1'],
'arm': ['board0', 'board1']}, []))
def testBoardArchSingle(self):
"""Test single board selection"""
- self.assertEqual(self.boards.SelectBoards(['arm sandbox']),
+ self.assertEqual(self.brds.SelectBoards(['arm sandbox']),
({'sandbox': ['board4'],
'all': ['board0', 'board1', 'board4'],
'arm': ['board0', 'board1']}, []))
def testBoardArchSingleMultiWord(self):
"""Test single board selection"""
- self.assertEqual(self.boards.SelectBoards(['arm', 'sandbox']),
+ self.assertEqual(self.brds.SelectBoards(['arm', 'sandbox']),
({'sandbox': ['board4'],
'all': ['board0', 'board1', 'board4'],
'arm': ['board0', 'board1']}, []))
def testBoardSingleAnd(self):
"""Test single board selection"""
- self.assertEqual(self.boards.SelectBoards(['Tester & arm']),
+ self.assertEqual(self.brds.SelectBoards(['Tester & arm']),
({'Tester&arm': ['board0', 'board1'],
'all': ['board0', 'board1']}, []))
def testBoardTwoAnd(self):
"""Test single board selection"""
- self.assertEqual(self.boards.SelectBoards(['Tester', '&', 'arm',
+ self.assertEqual(self.brds.SelectBoards(['Tester', '&', 'arm',
'Tester' '&', 'powerpc',
'sandbox']),
({'sandbox': ['board4'],
def testBoardAll(self):
"""Test single board selection"""
- self.assertEqual(self.boards.SelectBoards([]),
+ self.assertEqual(self.brds.SelectBoards([]),
({'all': ['board0', 'board1', 'board2', 'board3',
'board4']}, []))
def testBoardRegularExpression(self):
"""Test single board selection"""
- self.assertEqual(self.boards.SelectBoards(['T.*r&^Po']),
+ self.assertEqual(self.brds.SelectBoards(['T.*r&^Po']),
({'all': ['board2', 'board3'],
'T.*r&^Po': ['board2', 'board3']}, []))
def testBoardDuplicate(self):
"""Test single board selection"""
- self.assertEqual(self.boards.SelectBoards(['sandbox sandbox',
+ self.assertEqual(self.brds.SelectBoards(['sandbox sandbox',
'sandbox']),
({'all': ['board4'], 'sandbox': ['board4']}, []))
def CheckDirs(self, build, dirname):