- self.assertSummary(lines[2].text, 'sandbox', '+', ['board4'])
- self.assertSummary(lines[3].text, 'arm', '+', ['board1'])
- self.assertSummary(lines[4].text, 'powerpc', '+', ['board2', 'board3'])
-
- # Now we should have the compiler warning
- self.assertEqual(lines[5].text, 'w+%s' %
- errors[0].rstrip().replace('\n', '\nw+'))
- self.assertEqual(lines[5].colour, col.MAGENTA)
-
- self.assertEqual(lines[6].text, '03: %s' % commits[2][1])
- self.assertSummary(lines[7].text, 'sandbox', '+', ['board4'])
- self.assertSummary(lines[8].text, 'arm', '', ['board1'], ok=True)
- self.assertSummary(lines[9].text, 'powerpc', '+', ['board2', 'board3'])
-
- # Compiler error
- self.assertEqual(lines[10].text, '+%s' %
- errors[1].rstrip().replace('\n', '\n+'))
-
- self.assertEqual(lines[11].text, '04: %s' % commits[3][1])
- self.assertSummary(lines[12].text, 'sandbox', '', ['board4'], ok=True)
- self.assertSummary(lines[13].text, 'powerpc', '', ['board2', 'board3'],
- ok=True)
+ boards01234 = ('board0 board1 board2 board3 board4'
+ if list_error_boards else '')
+ boards1234 = 'board1 board2 board3 board4' if list_error_boards else ''
+ boards234 = 'board2 board3 board4' if list_error_boards else ''
+ boards34 = 'board3 board4' if list_error_boards else ''
+ boards4 = 'board4' if list_error_boards else ''
+
+ # Upstream commit: migration warnings only
+ self.assertEqual(next(lines).text, '01: %s' % commits[0][1])
+
+ if not filter_migration_warnings:
+ self.assertSummary(next(lines).text, 'arm', 'w+',
+ ['board0', 'board1'], outcome=OUTCOME_WARN)
+ self.assertSummary(next(lines).text, 'powerpc', 'w+',
+ ['board2', 'board3'], outcome=OUTCOME_WARN)
+ self.assertSummary(next(lines).text, 'sandbox', 'w+', ['board4'],
+ outcome=OUTCOME_WARN)
+
+ self.assertEqual(next(lines).text,
+ add_line_prefix('+', boards01234, migration, col.RED))
+
+ # Second commit: all archs should fail with warnings
+ self.assertEqual(next(lines).text, '02: %s' % commits[1][1])
+
+ if filter_migration_warnings:
+ self.assertSummary(next(lines).text, 'arm', 'w+',
+ ['board1'], outcome=OUTCOME_WARN)
+ self.assertSummary(next(lines).text, 'powerpc', 'w+',
+ ['board2', 'board3'], outcome=OUTCOME_WARN)
+ self.assertSummary(next(lines).text, 'sandbox', 'w+', ['board4'],
+ outcome=OUTCOME_WARN)
+
+ # Second commit: The warnings should be listed
+ self.assertEqual(next(lines).text,
+ add_line_prefix('w+', boards1234, errors[0], col.YELLOW))
+
+ # Third commit: Still fails
+ self.assertEqual(next(lines).text, '03: %s' % commits[2][1])
+ if filter_migration_warnings:
+ self.assertSummary(next(lines).text, 'arm', '',
+ ['board1'], outcome=OUTCOME_OK)
+ self.assertSummary(next(lines).text, 'powerpc', '+',
+ ['board2', 'board3'])
+ self.assertSummary(next(lines).text, 'sandbox', '+', ['board4'])
+
+ # Expect a compiler error
+ self.assertEqual(next(lines).text,
+ add_line_prefix('+', boards234, errors[1], col.RED))
+
+ # Fourth commit: Compile errors are fixed, just have warning for board3
+ self.assertEqual(next(lines).text, '04: %s' % commits[3][1])
+ if filter_migration_warnings:
+ expect = '%10s: ' % 'powerpc'
+ expect += ' ' + col.Color(col.GREEN, '')
+ expect += ' '
+ expect += col.Color(col.GREEN, ' %s' % 'board2')
+ expect += ' ' + col.Color(col.YELLOW, 'w+')
+ expect += ' '
+ expect += col.Color(col.YELLOW, ' %s' % 'board3')
+ self.assertEqual(next(lines).text, expect)
+ else:
+ self.assertSummary(next(lines).text, 'powerpc', 'w+',
+ ['board2', 'board3'], outcome=OUTCOME_WARN)
+ self.assertSummary(next(lines).text, 'sandbox', 'w+', ['board4'],
+ outcome=OUTCOME_WARN)