Bug 940924 - Marionette should list the number of unexpected/expected fails at the end of the test run. r=jgriffin

This commit is contained in:
Juien Pagès 2014-05-27 10:01:00 +02:00
Родитель ab7c8d296c
Коммит 973512dea6
1 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

@ -670,7 +670,9 @@ class BaseMarionetteTestRunner(object):
def reset_test_stats(self):
self.passed = 0
self.failed = 0
self.unexpected_successes = 0
self.todo = 0
self.skipped = 0
self.failures = []
def start_httpd(self, need_external_ip):
@ -820,8 +822,14 @@ class BaseMarionetteTestRunner(object):
counter -= 1
self.logger.info('\nSUMMARY\n-------')
self.logger.info('passed: %d' % self.passed)
self.logger.info('failed: %d' % self.failed)
self.logger.info('todo: %d' % self.todo)
if self.unexpected_successes == 0:
self.logger.info('failed: %d' % self.failed)
else:
self.logger.info('failed: %d (unexpected sucesses: %d)', self.failed, self.unexpected_successes)
if self.skipped == 0:
self.logger.info('todo: %d', self.todo)
else:
self.logger.info('todo: %d (skipped: %d)', self.todo, self.skipped)
if self.failed > 0:
self.logger.info('\nFAILED TESTS\n-------')
@ -988,16 +996,18 @@ class BaseMarionetteTestRunner(object):
self.failed += len(results.failures) + len(results.errors)
if hasattr(results, 'skipped'):
self.skipped += len(results.skipped)
self.todo += len(results.skipped)
self.passed += results.passed
for failure in results.failures + results.errors:
self.failures.append((results.getInfo(failure), failure.output, 'TEST-UNEXPECTED-FAIL'))
if hasattr(results, 'unexpectedSuccesses'):
self.failed += len(results.unexpectedSuccesses)
self.unexpected_successes += len(results.unexpectedSuccesses)
for failure in results.unexpectedSuccesses:
self.failures.append((results.getInfo(failure), 'TEST-UNEXPECTED-PASS'))
if hasattr(results, 'expectedFailures'):
self.passed += len(results.expectedFailures)
self.todo += len(results.expectedFailures)
def run_test_set(self, tests):
if self.shuffle: