| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was slightly too complicated to add to the existing
test_axis_updates test, so that test is duplicated here, only testing
what we see as "wheel" axis in the driver.
The test is run for all three pens
Because the X driver unconditionally sets ds->abswheel from the kernel
events, we must take care only to send the kernel axis that matters for
our current tool - otherwise we overwrite ds->abswheel with whichever
one of ABS_Z or ABS_WHEEL is sent last in the evdev frame.
In other words, we cannot test that artpen ignores ABS_WHEEL and
airbrush ignores ABS_Z because ... they don't.
For the generic pen that doesn't matter since we're supposed to ignore
both axes anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Tested-by: Ping Cheng <ping.cheng@wacom.com>
|
| |
|
|
|
|
|
|
|
|
| |
The tests need to run as root (for uinput/evdev) so pip-installing a
package as user gets past the build check but then fails at runtime.
Let's make this bit easier to debug.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The event data has a mask field that specifies which fields are actually
present (zero may be a valid value for an axis after all). Let's check
that mask for each event and ensure that if the pen supports the axis,
the axis is also present in the event.
We still send kernel events for all axes to ensure the unsupported ones
are correctly ignored by the driver.
This allows us to parametrize the test with different stylus types and
re-use the rest. Here we add a standard Cintiq pen and make sure the
wheel axis is never set.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Set an option on all our created uinput devices, and an environment
variable when we're running the test suite. If both of these are set we
process the device, otherwise ignore the device during PreInit.
This stops the driver picking up events from test suite runs
(potentially clicking around on the desktop) and it stops the test suite
from false positives by locally connected devices.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The artpen has a physical rotation property, sent by the kernel driver
as ABS_Z (historical reasons). In the driver this is mapped to the
ds->abswheel state because this axis is shared with the airbrush wheel -
both are sent through the same XI valuator (historical reasons, as
usual).
We can rather easily test this by ensuring we have an artpen device id
and then send something through ABS_Z, that should update the wheel
axis.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Aaron Skomra <aaron.skomra@wacom.com>
|
|
|
|
|
|
|
|
|
| |
This avoids a potential stuck button by leaving the tablet in proximity.
Shouldn't happen since removing the device should release all buttons
but...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Aaron Skomra <aaron.skomra@wacom.com>
|
|
|
|
|
|
|
|
|
| |
This ensures we get a StopIteration exception if we don't have the
events we expect - previously we'd get a false positive on this test if
we had no motion events after the first one.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Aaron Skomra <aaron.skomra@wacom.com>
|
|
|
|
|
|
|
|
| |
Make it 30% of the axis in 2% step increments, this gets past the issue
of tilt not updating significantly and getting filtered.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Aaron Skomra <aaron.skomra@wacom.com>
|
|
|
|
|
|
|
|
|
|
| |
Because InputId didn't have the same field order as the recording (to
allow for default bustype, vid and version), we ended up with an
erroneous vendor ID, causing some code paths in the driver to go the
non-wacom path.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Aaron Skomra <aaron.skomra@wacom.com>
|
|
|
|
|
|
|
|
|
|
|
| |
$ sudo ./test/wacom-test-env.sh
$ pytest
A lot easier this way than having to manually set the environment
variables.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Aaron Skomra <aaron.skomra@wacom.com>
|
|
|
|
|
|
|
|
|
| |
When building with Meson, a number of CFLAGS are automatically used
if supported by the compiler. Lets copy them over so that the same
behavior will occur for autotools users. While we're at it, update
the other target-specific flags to also better match Meson.
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
|
|
|
|
|
|
| |
Just a test that if we change x, only x changes in the events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This test suite makes use of the gwacom library and its GObject
bindings, allowing us to write the actual tests in python.
Real devices can be specified as a YAML file in test/devices.
In the tests we can either create custom device or load the correct
Pen/Finger/Pad component from the real device. Devices are then created
as uinput devices [1], with a Monitor class set up to capture any
events.
The test needs to initialize that device and monitor, then play events
through the device and analyze the output.
[1] This unfortunately won't work in containers, like the github CI...
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Distribution package builds that use -Wl,-z,relro -Wl,-z,now will
attempt to resolve all symbols on dlopen(). This is explicitly what we
do not want because we don't link in the whole X server.
It's a bit hard to override this for a single executable (my attempts
didn't go far so there may be some other flag that influences this too)
so for now just skip the whole test - this is better than failing the
test suite.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
Accidentally added during development, renamed later to
wacom-tests.c but not removed correctly
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This works around an issue running our test suite through clang with
asan. Specifically, the asan test fails with:
ERROR: AddressSanitizer: global-buffer-overflow on address
#0 0x7f31314a1b57 in wcm_run_tests [...] wacom-test-suite.c:44:3
...
0x7f31314ff150 is located 48 bytes to the left of global variable '_decl_test_get_wheel_button' defined in '../src/wcmCommon.c:1802:1' (0x7f31314ff180) of size 16
0x7f31314ff150 is located 0 bytes to the right of global variable '_decl_test_get_scroll_delta' defined in '../src/wcmCommon.c:1754:1' (0x7f31314ff140) of size 16
The C standard doesn't guarantee that sections are immediately
next to each other, so our expected behavior could break in the future.
Since this is a test suite, we don't really care for now. And I rather
suspect there's plenty of code out there that too would break if clang
ever changed this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous approach, written 11 years ago, relied on providing all
symbols the driver needs as stubs (see fake-symbols.c). Most of these
symbols just needed to be there so we could compile the test, they
didn't actually get utilized by the tests.
Dropping this and instead add something roughly similar to Rust: the
test function can be in the same file as the source function.
The TEST_CASE() macro uses __attribute__((section)) to push the test
cases in custom ELF section. This section we can iterate on and call all
tests one-by-one. The test runner only needs to dlopen + dlsym the
driver module and run the entry point function.
The test-suite part of this is minimal: tests can assert on failure and
everything stops. Adding things like fnmatch for test case names is
possible when/if we ever need it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
| |
We have driver and device logging, and each as a normal log function, a
sigsafe log path and a debug message log path. So 6 functions overall.
This doesn't matter for the X driver which routes sigsafe to
LogMessageVerbSigSafe but for other frontends it's useful to keep these
apart.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
In both cases we'll use that context in a follow-up patch to hook into
the logging functions.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
| |
The init code remains largely as-is but as soon as sensible, change this
to an enum value and keep it in the device. The X driver layer can
convert that into the type_name as required.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
These are just lumped in for convenience, let's split them and move the
type name to the X driver layer.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
This is a simple helper function, easier to have this locally than rely
on the X server API here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
| |
This wraps the X-specific xf86IDrvMsg/LogMessageVerbSigSafe into a
wcmLog() function. That then calls the X functions, depending on whether
we have context as first argument or not.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes all functions (wherever possible) to take a WacomDevicePtr
instead of an InputInfoPtr as context argument, with the InputInfoPtr
either assigned to priv->pInfo or removed where now superfluous.
This should have no functional changes.
Remaining functions are those required by the X server to have a certain
signature.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
| |
Released 9 years ago and available in e.g. RHEL6.4 and later, this is
plenty old an X server to support. ABI version 18.0 so we can get rid of
most of our ifdefs.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
There's no case where this is not defined
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
The latter skips over '_ \t' but none of the options we parse will have
any of those characters in it. Let's use strcasecmp() directly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
| |
That's all the server does anyway for these calls. That and some
debugging printf of the data but that would require the server to be
build with those debugging flags enabled.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
They don't test much but it's still better to always build them so we
don't have to chase down compilation errors after the fact.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
This function was added in server 1.10, released in Feb 2011. Bump the
requirements accordingly.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
| |
Released in 2011 and available in RHEL6.2 and later, this should be
conservative enough. It allows us to drop a bunch of code that requires
older ABIs (anything ABI_XINPUT_VERSION < 12).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit d958ab79d2 changes the driver's pressure normalization functions
to use a variable "maxCurve" which defines the upper limit of pressure
values to be emitted by the driver, rather than using FILTER_PRESSURE_RES
directly. The tests were never updated to take this into account and
fail due to maxCurve never being set.
This patch has the normalize_pressure test set the value of maxCurve.
While we're at it, we have the test verify that multiple values of
maxCurve work as expected.
Fixes: d958ab79d2 (Introduce "Pressure2K" config option for incompatible software)
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
|
|
|
|
|
|
| |
Fixes distcheck
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The X server recently deprecated xf86BlockSIGIO and xf86UnblockSIGIO and
simultaneously defined them inline within xf86.h. The new inline definition
causes problems both because fake-symbols.c will end up redefining them,
and because the function bodies reference a symbol that does not get included
when building the tests. To fix these errors, update fake-symbols.c with
updated include guards and a definition of the undefined symbols.
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
| |
Reducing clutter.
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Ping Cheng <pingc@wacom.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the initial pressure of a device is != 0 the driver recalibrates
the pressure range. This is to account for worn out devices.
The downside is that when the user hits the tablet very hard the
initial pressure reading may be unequal to zero even for a perfectly
good pen. If the consecutive pressure readings are not higher than
the initial pressure by a threshold no button event will be generated.
This option allows to disable the recalibration.
Signed-off-by: Egbert Eich <eich@suse.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Worn out devices send a non-zero pressure even when not in contact
with the tablet. To compensate for this the driver detects if the
pressure sent by the device immediately after indicating proximity
is non-zero. It subtracts this value from any pressure value sent
later and rescales the pressure range to the full device range.
If it later on sees the pressure value fall below this initial value
it will readjust it this lower value.
The downside of this is that when the pen is pushed onto the tablet
really fast the initial pressure reading may be non-zero also the
pen isn't worn. This can lead to lost events.
This patch tries to address this:
If the first pressure reading is != 0 it is recorded. If the recorded
maximum value is >0 but a later pressure reading is higher the maximum
value is replaced. If no button press event is generated the 'normal'
way it is checked of the recorded maximum would trigger one when
minPressure decreases.
Once a 'normal' button event is generated or an 'alternative' button
event is generated and minPressure doesn't decrease any more the
recorded maximum is set to 0 which will disable the checks until the
next prox in.
Signed-off-by: Egbert Eich <eich@suse.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
|
|
|
|
|
|
| |
Signed-off-by: Egbert Eich <eich@suse.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
| |
Pinning variables to some value to fix warning about uninitialized
variable.
Signed-off-by: Egbert Eich <eich@suse.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
| |
Signed-off-by: Egbert Eich <eich@suse.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This gets rid of the hack which redefines 'static' to make
every static function in the driver non-static for the test
suite.
Instead we use a macro instead of 'static' in the function definition
of each function used in the test suite which we can set to empty
when compiling the test suite.
At the same time we create a declaration for each of those functions
which gets us rind of about a bazillion compiler warnings.
Signed-off-by: Egbert Eich <eich@suse.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
| |
Signed-off-by: Egbert Eich <eich@suse.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most symbols in fake-symbols.h were already declared in the
Xserver header files from the SDK which are also included.
These produce loads of compiler warnings.
The few remaining ones can be added by including xf86_OSproc.h
and exevents.h.
Then then all function declarations for the stub functions
can be deleted.
Relying on SDK provided headers makes providing stub functions
cumbersome due to frequent non-atomic API/ABI changes.
To work around this one would have to avoid SDK headers completely,
though.
Signed-off-by: Egbert Eich <eich@suse.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|
|
|
|
|
|
|
|
|
|
| |
Add CONST which expands to either 'const' or nothing depending
on ABI version.
This eliminates a compiler error.
Signed-off-by: Egbert Eich <eich@suse.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
|