* [PATCH v1] selftests: hid: tests: test_wacom_generic: add base test for display devices and opaque devices
@ 2025-11-17 1:47 Alex Tran
2025-11-20 10:53 ` Benjamin Tissoires
2025-11-21 0:04 ` [PATCH v2] selftests: hid: tests: test_wacom_generic: add tests " Alex Tran
0 siblings, 2 replies; 4+ messages in thread
From: Alex Tran @ 2025-11-17 1:47 UTC (permalink / raw)
To: jikos, bentiss, shuah
Cc: linux-input, linux-kselftest, linux-kernel, Alex Tran
Verify Wacom devices set INPUT_PROP_DIRECT appropriately on display devices
and INPUT_PROP_POINTER appropriately on opaque devices. Tests are defined
in the base class and disabled for inapplicable device types.
Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
---
.../selftests/hid/tests/test_wacom_generic.py | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/hid/tests/test_wacom_generic.py b/tools/testing/selftests/hid/tests/test_wacom_generic.py
index 2d6d04f0f..aa2a175f2 100644
--- a/tools/testing/selftests/hid/tests/test_wacom_generic.py
+++ b/tools/testing/selftests/hid/tests/test_wacom_generic.py
@@ -600,15 +600,17 @@ class BaseTest:
def test_prop_direct(self):
"""
- Todo: Verify that INPUT_PROP_DIRECT is set on display devices.
+ Verify that INPUT_PROP_DIRECT is set on display devices.
"""
- pass
+ evdev = self.uhdev.get_evdev()
+ assert libevdev.INPUT_PROP_DIRECT in evdev.properties
def test_prop_pointer(self):
"""
- Todo: Verify that INPUT_PROP_POINTER is set on opaque devices.
+ Verify that INPUT_PROP_POINTER is set on opaque devices.
"""
- pass
+ evdev = self.uhdev.get_evdev()
+ assert libevdev.INPUT_PROP_POINTER in evdev.properties
class PenTabletTest(BaseTest.TestTablet):
@@ -622,6 +624,8 @@ class TouchTabletTest(BaseTest.TestTablet):
class TestOpaqueTablet(PenTabletTest):
+ test_prop_direct = None
+
def create_device(self):
return OpaqueTablet()
@@ -864,6 +868,7 @@ class TestPTHX60_Pen(TestOpaqueCTLTablet):
class TestDTH2452Tablet(test_multitouch.BaseTest.TestMultitouch, TouchTabletTest):
ContactIds = namedtuple("ContactIds", "contact_id, tracking_id, slot_num")
+ test_prop_pointer = None
def create_device(self):
return test_multitouch.Digitizer(
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v1] selftests: hid: tests: test_wacom_generic: add base test for display devices and opaque devices
2025-11-17 1:47 [PATCH v1] selftests: hid: tests: test_wacom_generic: add base test for display devices and opaque devices Alex Tran
@ 2025-11-20 10:53 ` Benjamin Tissoires
2025-11-20 17:42 ` Alex Tran
2025-11-21 0:04 ` [PATCH v2] selftests: hid: tests: test_wacom_generic: add tests " Alex Tran
1 sibling, 1 reply; 4+ messages in thread
From: Benjamin Tissoires @ 2025-11-20 10:53 UTC (permalink / raw)
To: Alex Tran; +Cc: jikos, shuah, linux-input, linux-kselftest, linux-kernel
Hi Alex,
On Nov 16 2025, Alex Tran wrote:
> Verify Wacom devices set INPUT_PROP_DIRECT appropriately on display devices
> and INPUT_PROP_POINTER appropriately on opaque devices. Tests are defined
> in the base class and disabled for inapplicable device types.
>
> Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
> ---
> .../selftests/hid/tests/test_wacom_generic.py | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/hid/tests/test_wacom_generic.py b/tools/testing/selftests/hid/tests/test_wacom_generic.py
> index 2d6d04f0f..aa2a175f2 100644
> --- a/tools/testing/selftests/hid/tests/test_wacom_generic.py
> +++ b/tools/testing/selftests/hid/tests/test_wacom_generic.py
> @@ -600,15 +600,17 @@ class BaseTest:
>
> def test_prop_direct(self):
> """
> - Todo: Verify that INPUT_PROP_DIRECT is set on display devices.
> + Verify that INPUT_PROP_DIRECT is set on display devices.
> """
> - pass
> + evdev = self.uhdev.get_evdev()
> + assert libevdev.INPUT_PROP_DIRECT in evdev.properties
>
> def test_prop_pointer(self):
> """
> - Todo: Verify that INPUT_PROP_POINTER is set on opaque devices.
> + Verify that INPUT_PROP_POINTER is set on opaque devices.
> """
> - pass
> + evdev = self.uhdev.get_evdev()
> + assert libevdev.INPUT_PROP_POINTER in evdev.properties
>
>
> class PenTabletTest(BaseTest.TestTablet):
> @@ -622,6 +624,8 @@ class TouchTabletTest(BaseTest.TestTablet):
>
>
> class TestOpaqueTablet(PenTabletTest):
> + test_prop_direct = None
That seems very awkward to do.
Why not drop the 2 tests from the TestTablet class, move
`test_prop_direct()` in that subclass (TestOpaqueTablet), and add a new
TestDirectTablet class that TestDTH2452Tablet will be a subclass of?
Basically try to make better use of subclassing instead of adding the
tests at the top level class and selectively remove them in the
subclasses.
Cheers,
Benjamin
> +
> def create_device(self):
> return OpaqueTablet()
>
> @@ -864,6 +868,7 @@ class TestPTHX60_Pen(TestOpaqueCTLTablet):
>
> class TestDTH2452Tablet(test_multitouch.BaseTest.TestMultitouch, TouchTabletTest):
> ContactIds = namedtuple("ContactIds", "contact_id, tracking_id, slot_num")
> + test_prop_pointer = None
>
> def create_device(self):
> return test_multitouch.Digitizer(
> --
> 2.51.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v1] selftests: hid: tests: test_wacom_generic: add base test for display devices and opaque devices
2025-11-20 10:53 ` Benjamin Tissoires
@ 2025-11-20 17:42 ` Alex Tran
0 siblings, 0 replies; 4+ messages in thread
From: Alex Tran @ 2025-11-20 17:42 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: jikos, shuah, linux-input, linux-kselftest, linux-kernel
On Thu, Nov 20, 2025 at 2:53 AM Benjamin Tissoires <bentiss@kernel.org> wrote:
>
> Hi Alex,
>
> On Nov 16 2025, Alex Tran wrote:
> > Verify Wacom devices set INPUT_PROP_DIRECT appropriately on display devices
> > and INPUT_PROP_POINTER appropriately on opaque devices. Tests are defined
> > in the base class and disabled for inapplicable device types.
> >
> > Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
> > ---
> > .../selftests/hid/tests/test_wacom_generic.py | 13 +++++++++----
> > 1 file changed, 9 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/testing/selftests/hid/tests/test_wacom_generic.py b/tools/testing/selftests/hid/tests/test_wacom_generic.py
> > index 2d6d04f0f..aa2a175f2 100644
> > --- a/tools/testing/selftests/hid/tests/test_wacom_generic.py
> > +++ b/tools/testing/selftests/hid/tests/test_wacom_generic.py
> > @@ -600,15 +600,17 @@ class BaseTest:
> >
> > def test_prop_direct(self):
> > """
> > - Todo: Verify that INPUT_PROP_DIRECT is set on display devices.
> > + Verify that INPUT_PROP_DIRECT is set on display devices.
> > """
> > - pass
> > + evdev = self.uhdev.get_evdev()
> > + assert libevdev.INPUT_PROP_DIRECT in evdev.properties
> >
> > def test_prop_pointer(self):
> > """
> > - Todo: Verify that INPUT_PROP_POINTER is set on opaque devices.
> > + Verify that INPUT_PROP_POINTER is set on opaque devices.
> > """
> > - pass
> > + evdev = self.uhdev.get_evdev()
> > + assert libevdev.INPUT_PROP_POINTER in evdev.properties
> >
> >
> > class PenTabletTest(BaseTest.TestTablet):
> > @@ -622,6 +624,8 @@ class TouchTabletTest(BaseTest.TestTablet):
> >
> >
> > class TestOpaqueTablet(PenTabletTest):
> > + test_prop_direct = None
>
> That seems very awkward to do.
>
> Why not drop the 2 tests from the TestTablet class, move
> `test_prop_direct()` in that subclass (TestOpaqueTablet), and add a new
> TestDirectTablet class that TestDTH2452Tablet will be a subclass of?
>
> Basically try to make better use of subclassing instead of adding the
> tests at the top level class and selectively remove them in the
> subclasses.
>
> Cheers,
> Benjamin
>
> > +
> > def create_device(self):
> > return OpaqueTablet()
> >
> > @@ -864,6 +868,7 @@ class TestPTHX60_Pen(TestOpaqueCTLTablet):
> >
> > class TestDTH2452Tablet(test_multitouch.BaseTest.TestMultitouch, TouchTabletTest):
> > ContactIds = namedtuple("ContactIds", "contact_id, tracking_id, slot_num")
> > + test_prop_pointer = None
> >
> > def create_device(self):
> > return test_multitouch.Digitizer(
> > --
> > 2.51.0
> >
Thanks for the review. Yes, it seems like a good idea to restructure
the class hierarchy instead of disabling the
tests like this. I'll send in a v2 with the changes soon.
Regards,
--
Alex Tran
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] selftests: hid: tests: test_wacom_generic: add tests for display devices and opaque devices
2025-11-17 1:47 [PATCH v1] selftests: hid: tests: test_wacom_generic: add base test for display devices and opaque devices Alex Tran
2025-11-20 10:53 ` Benjamin Tissoires
@ 2025-11-21 0:04 ` Alex Tran
1 sibling, 0 replies; 4+ messages in thread
From: Alex Tran @ 2025-11-21 0:04 UTC (permalink / raw)
To: jikos, bentiss, shuah
Cc: linux-input, linux-kselftest, linux-kernel, Alex Tran
Verify Wacom devices set INPUT_PROP_DIRECT on display devices and
INPUT_PROP_POINTER on opaque devices. Moved test_prop_pointer into
TestOpaqueTablet. Created a DirectTabletTest mixin class for
test_prop_direct that can be inherited by display tablet test classes.
Used DirectTabletTest for TestDTH2452Tablet case.
Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
---
Changes in v2:
- Removed the tests from the BaseTest class
- Removed disabling tests for certain subclasses
- Moved test_prop_pointer under TestOpaqueTablet
- Created DirectTabletTest mixin class
- Moved test_prop_direct under TestDTH2452Tablet
.../selftests/hid/tests/test_wacom_generic.py | 30 +++++++++++--------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/tools/testing/selftests/hid/tests/test_wacom_generic.py b/tools/testing/selftests/hid/tests/test_wacom_generic.py
index 2d6d04f0f..9d0b0802d 100644
--- a/tools/testing/selftests/hid/tests/test_wacom_generic.py
+++ b/tools/testing/selftests/hid/tests/test_wacom_generic.py
@@ -598,18 +598,6 @@ class BaseTest:
if unit_set:
assert required[usage].contains(field)
- def test_prop_direct(self):
- """
- Todo: Verify that INPUT_PROP_DIRECT is set on display devices.
- """
- pass
-
- def test_prop_pointer(self):
- """
- Todo: Verify that INPUT_PROP_POINTER is set on opaque devices.
- """
- pass
-
class PenTabletTest(BaseTest.TestTablet):
def assertName(self, uhdev):
@@ -677,6 +665,13 @@ class TestOpaqueTablet(PenTabletTest):
uhdev.event(130, 240, pressure=0), [], auto_syn=False, strict=True
)
+ def test_prop_pointer(self):
+ """
+ Verify that INPUT_PROP_POINTER is set on opaque devices.
+ """
+ evdev = self.uhdev.get_evdev()
+ assert libevdev.INPUT_PROP_POINTER in evdev.properties
+
class TestOpaqueCTLTablet(TestOpaqueTablet):
def create_device(self):
@@ -862,7 +857,16 @@ class TestPTHX60_Pen(TestOpaqueCTLTablet):
)
-class TestDTH2452Tablet(test_multitouch.BaseTest.TestMultitouch, TouchTabletTest):
+class DirectTabletTest():
+ def test_prop_direct(self):
+ """
+ Verify that INPUT_PROP_DIRECT is set on display devices.
+ """
+ evdev = self.uhdev.get_evdev()
+ assert libevdev.INPUT_PROP_DIRECT in evdev.properties
+
+
+class TestDTH2452Tablet(test_multitouch.BaseTest.TestMultitouch, TouchTabletTest, DirectTabletTest):
ContactIds = namedtuple("ContactIds", "contact_id, tracking_id, slot_num")
def create_device(self):
--
2.51.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-21 0:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17 1:47 [PATCH v1] selftests: hid: tests: test_wacom_generic: add base test for display devices and opaque devices Alex Tran
2025-11-20 10:53 ` Benjamin Tissoires
2025-11-20 17:42 ` Alex Tran
2025-11-21 0:04 ` [PATCH v2] selftests: hid: tests: test_wacom_generic: add tests " Alex Tran
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).