If there are both warnings and errors, errors win, so buildman returns 128.
+The -y option is provided (for use with -s) to ignore the bountiful device-tree
+warnings.
+
How to change from MAKEALL
==========================
def SetDisplayOptions(self, show_errors=False, show_sizes=False,
show_detail=False, show_bloat=False,
list_error_boards=False, show_config=False,
- show_environment=False):
+ show_environment=False, filter_dtb_warnings=False):
"""Setup display options for the builder.
- show_errors: True to show summarised error/warning info
- show_sizes: Show size deltas
- show_detail: Show size delta detail for each board if show_sizes
- show_bloat: Show detail for each function
- list_error_boards: Show the boards which caused each error/warning
- show_config: Show config deltas
- show_environment: Show environment deltas
+ Args:
+ show_errors: True to show summarised error/warning info
+ show_sizes: Show size deltas
+ show_detail: Show size delta detail for each board if show_sizes
+ show_bloat: Show detail for each function
+ list_error_boards: Show the boards which caused each error/warning
+ show_config: Show config deltas
+ show_environment: Show environment deltas
+ filter_dtb_warnings: Filter out any warnings from the device-tree
+ compiler
"""
self._show_errors = show_errors
self._show_sizes = show_sizes
self._list_error_boards = list_error_boards
self._show_config = show_config
self._show_environment = show_environment
+ self._filter_dtb_warnings = filter_dtb_warnings
def _AddTimestamp(self):
"""Add a new timestamp to the list and record the build period.
"""
out_lines = []
for line in lines:
- if not self.re_make_err.search(line):
- out_lines.append(line)
+ if self.re_make_err.search(line):
+ continue
+ if self._filter_dtb_warnings and self._re_dtb_warning.search(line):
+ continue
+ out_lines.append(line)
return out_lines
def ReadFuncSizes(self, fname, fd):
parser.add_option('-x', '--exclude', dest='exclude',
type='string', action='append',
help='Specify a list of boards to exclude, separated by comma')
+ parser.add_option('-y', '--filter-dtb-warnings', action='store_true',
+ default=False,
+ help='Filter out device-tree-compiler warnings from output')
parser.usage += """ [list of target/arch/cpu/board/vendor/soc to build]
commits = None
Print(GetActionSummary(options.summary, commits, board_selected,
- options))
+ options))
# We can't show function sizes without board details at present
if options.show_bloat:
options.show_detail = True
- builder.SetDisplayOptions(options.show_errors, options.show_sizes,
- options.show_detail, options.show_bloat,
- options.list_error_boards,
- options.show_config,
- options.show_environment)
+ builder.SetDisplayOptions(
+ options.show_errors, options.show_sizes, options.show_detail,
+ options.show_bloat, options.list_error_boards, options.show_config,
+ options.show_environment, options.filter_dtb_warnings)
if options.summary:
builder.ShowSummary(commits, board_selected)
else:
terminal.EchoPrintTestLines()
return iter(terminal.GetPrintTestLines())
- def _CheckOutput(self, lines, list_error_boards):
+ def _CheckOutput(self, lines, list_error_boards, filter_dtb_warnings):
"""Check for expected output from the build summary
Args:
lines: Iterator containing the lines returned from the summary
list_error_boards: Adjust the check for output produced with the
--list-error-boards flag
+ filter_dtb_warnings: Adjust the check for output produced with the
+ --filter-dtb-warnings flag
"""
def add_line_prefix(prefix, boards, error_str, colour):
"""Add a prefix to each line of a string
self.assertEqual(next(lines).text,
add_line_prefix('-', boards234, errors[1], col.GREEN))
- self.assertEqual(next(lines).text,
- add_line_prefix('w+', boards34, errors[2], col.YELLOW))
+ if not filter_dtb_warnings:
+ self.assertEqual(
+ next(lines).text,
+ add_line_prefix('w+', boards34, errors[2], col.YELLOW))
# Fifth commit
self.assertEqual(next(lines).text, '05: %s' % commits[4][1])
self.assertEqual(next(lines).text,
add_line_prefix('+', boards4, expect, col.RED))
- self.assertEqual(next(lines).text,
- add_line_prefix('w-', boards34, errors[2], col.CYAN))
+ if not filter_dtb_warnings:
+ self.assertEqual(
+ next(lines).text,
+ add_line_prefix('w-', boards34, errors[2], col.CYAN))
# Sixth commit
self.assertEqual(next(lines).text, '06: %s' % commits[5][1])
This does a line-by-line verification of the summary output.
"""
lines = self._SetupTest(show_errors=True)
- self._CheckOutput(lines, list_error_boards=False)
+ self._CheckOutput(lines, list_error_boards=False,
+ filter_dtb_warnings=False)
def testErrorBoards(self):
"""Test output with --list-error-boards
This does a line-by-line verification of the summary output.
"""
lines = self._SetupTest(show_errors=True, list_error_boards=True)
- self._CheckOutput(lines, list_error_boards=True)
+ self._CheckOutput(lines, list_error_boards=True,
+ filter_dtb_warnings=False)
+
+ def testFilterDtb(self):
+ """Test output with --filter-dtb-warnings
+
+ This does a line-by-line verification of the summary output.
+ """
+ lines = self._SetupTest(show_errors=True, filter_dtb_warnings=True)
+ self._CheckOutput(lines, list_error_boards=False,
+ filter_dtb_warnings=True)
def _testGit(self):
"""Test basic builder operation by building a branch"""