Skip to content

Commit

Permalink
[webkitcorepy] Improve logging for incorrect test arguments
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258533
rdar://111348949

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/python_test_runner.py:
(PythonTestRunner.tests): Explain that test arguments are of the form <module>.<file>.<class>.<function>.

Canonical link: https://commits.webkit.org/266108@main
  • Loading branch information
JonWBedard committed Jul 17, 2023
1 parent f044b63 commit ce2b6a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 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.1',
version='0.16.2',
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, 1)
version = Version(0, 16, 2)

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 @@ -65,7 +65,9 @@ def __init__(self, description, loggers=None, modules=None, patterns=None):
def tests(self, args=None):
filters = [] if not args or not args.tests else args.tests
matched_filters = {pattern.pattern: 0 for pattern in filters}
example = None
for name in self._tests.keys():
example = name
if not filters:
yield name
did_match = False
Expand All @@ -82,6 +84,9 @@ def tests(self, args=None):
if count:
continue
sys.stderr.write("No tests match '{}'\n".format(pattern.replace('.*', '*').replace('**', '*')))
sys.stderr.write("Specify tests names in the form '<module>.<file>.<class>.<function>'\n")
if example:
sys.stderr.write("For example: '{} {}'\n".format(sys.argv[0].split('/')[-1], example.split('.')[0]))
must_exit = True
if must_exit:
sys.exit(-1)
Expand Down

0 comments on commit ce2b6a5

Please sign in to comment.