summaryrefslogtreecommitdiff
path: root/test/litest-device-lid-switch.c
Commit message (Collapse)AuthorAgeFilesLines
* test: auto-generate the udev rulesPeter Hutterer2019-06-141-10/+4
| | | | | | | | | We only ever set properties in the devices, so let's make that more explicit and auto-generate the udev rule. This way we're hopefully better protected from the various typos that hid in those rules over the years, but also be prepared for passing the udev property key/value pairs elsewhere. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Switch from udev property parsing to the quirks systemPeter Hutterer2018-06-081-2/+7
| | | | Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: drop the * from the Lid Switch test device udev rule matchPeter Hutterer2018-03-211-1/+1
| | | | | | | | | This is the cause of the random test case failures. Because the rule for this device would also match on the Surface3 lid switch test device it comes down to whatever mkstemps() picked as the unique characters. When the Surface3 sorted later, everything worked, otherwise it would fail. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: switch to a TEST_DEVICE macro for all the litest test devicesPeter Hutterer2017-09-211-11/+2
| | | | | | | | | | | | | | | | The test device initialization code was a bit of duplicated boilerplate and required adding a reference to the devices to the 'devices' list in litest.c. Automate this with a new TEST_DEVICE macro that adds the devices to a custom section in the binary, then loops throught that section to get the device out. This reduces the boilerplate for each test device to just the TEST_MACRO and the LITEST_foo device enum entry. It also now automates the shortname of the device. The device's shortname was standardised in this approach as well, lowercase and dashes only. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* switch: only sync the initial state if we know the state is reliablePeter Hutterer2017-01-261-1/+2
| | | | | | | | | This changes the default behavior to "disable the touchpad on the first lid close event", thus filtering any laptops where the switch state is buggy and always in "on" state. Devices where we know the lid switch state is reliable can be marked as such. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* test: add tests for lid switchJames Ye2017-01-261-0/+69
Ship a custom udev rule for the test device until systemd v333 is commonplace. Signed-off-by: James Ye <jye836@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>