Skip to content

Commit

Permalink
[webkitcorepy] Handle multiple failures in a single test
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258594
rdar://111421739

Reviewed by Aakash Jain.

* Tools/Scripts/libraries/webkitcorepy/setup.py: Bump version.
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/__init__.py: Ditto.
* Tools/Scripts/libraries/webkitcorepy/webkitcorepy/testing/test_runner.py:
(TestRunner.run): Print all failures for a single test.

Canonical link: https://commits.webkit.org/266109@main
  • Loading branch information
JonWBedard committed Jul 17, 2023
1 parent ce2b6a5 commit cbb2771
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Tools/Scripts/libraries/webkitcorepy/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def readme():

setup(
name='webkitcorepy',
version='0.16.2',
version='0.16.3',
description='Library containing various Python support classes and functions.',
long_description=readme(),
classifiers=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
from webkitcorepy.filtered_call import filtered_call
from webkitcorepy.partial_proxy import PartialProxy

version = Version(0, 16, 2)
version = Version(0, 16, 3)

from webkitcorepy.autoinstall import Package, AutoInstall
if sys.version_info > (3, 0):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,32 @@ def run(self, args):
incremental = self.run_test(test)
results = self.combine(results, incremental)

sys.stdout.write(' ')
result = False
for description, attribute in (('failed', 'failures'), ('erred', 'errors')):
value = getattr(incremental, attribute)
if not value:
continue
sys.stdout.write(' {}\n'.format(description))
sys.stdout.write('{}\n'.format(description))
if args.log_level <= logging.ERROR:
sys.stderr.write('\n')
if not result:
sys.stderr.write('\n')
for member in value:
sys.stderr.write(member[1] + '\n')
break
result = True
if result:
continue

if incremental.skipped or not incremental.testsRun:
chars += 8
sys.stdout.write('skipped\n')
else:
if incremental.skipped or not incremental.testsRun:
chars += 8
sys.stdout.write(' skipped\n')
else:
chars += 7
sys.stdout.write(' passed\n')

if args.log_level >= logging.WARNING and sys.stdout.isatty():
_, columns = Terminal.size()
sys.stdout.write('\033[F\033[K' * math.ceil(chars / (columns or chars)))
chars += 7
sys.stdout.write('passed\n')

if args.log_level >= logging.WARNING and sys.stdout.isatty():
_, columns = Terminal.size()
sys.stdout.write('\033[F\033[K' * math.ceil(chars / (columns or chars)))

except KeyboardInterrupt:
sys.stderr.write('\nUser interupted the program\n\n')
Expand Down

0 comments on commit cbb2771

Please sign in to comment.