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 <[email protected]>
> ---
> .../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
>