Skip to content

Commit

Permalink
Merge branch 'for-6.8/selftests' into for-linus
Browse files Browse the repository at this point in the history
- greatly improved coverage of Tablets in hid-selftests (Benjamin Tissoires)
  • Loading branch information
Jiri Kosina committed Jan 8, 2024
2 parents f54a651 + da2c1b8 commit 1cb09b5
Show file tree
Hide file tree
Showing 5 changed files with 567 additions and 270 deletions.
7 changes: 3 additions & 4 deletions tools/testing/selftests/hid/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from hidtools.device.base_device import BaseDevice, EvdevMatch, SysfsFile
from pathlib import Path
from typing import Final
from typing import Final, List, Tuple

logger = logging.getLogger("hidtools.test.base")

Expand Down Expand Up @@ -155,7 +155,7 @@ class TestUhid(object):
# if any module is not available (not compiled), the test will skip.
# Each element is a tuple '(kernel driver name, kernel module)',
# for example ("playstation", "hid-playstation")
kernel_modules = []
kernel_modules: List[Tuple[str, str]] = []

def assertInputEventsIn(self, expected_events, effective_events):
effective_events = effective_events.copy()
Expand Down Expand Up @@ -238,8 +238,7 @@ def context(self, new_uhdev, request):
try:
with HIDTestUdevRule.instance():
with new_uhdev as self.uhdev:
skip_cond = request.node.get_closest_marker("skip_if_uhdev")
if skip_cond:
for skip_cond in request.node.iter_markers("skip_if_uhdev"):
test, message, *rest = skip_cond.args

if test(self.uhdev):
Expand Down
14 changes: 7 additions & 7 deletions tools/testing/selftests/hid/tests/test_mouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ def create_report(self, x, y, buttons=None, wheels=None, reportID=None):
:param reportID: the numeric report ID for this report, if needed
"""
if buttons is not None:
l, r, m = buttons
if l is not None:
self.left = l
if r is not None:
self.right = r
if m is not None:
self.middle = m
left, right, middle = buttons
if left is not None:
self.left = left
if right is not None:
self.right = right
if middle is not None:
self.middle = middle
left = self.left
right = self.right
middle = self.middle
Expand Down
Loading

0 comments on commit 1cb09b5

Please sign in to comment.