Commit graph

674 commits

Author SHA1 Message Date
Peter Hutterer
d209b66930 gitlab CI: rename the default build jobs to autotools
Prep the path for adding meson

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 14:49:25 +10:00
Peter Hutterer
67b6e447e7 Auto-generate the gitlab CI script
There is so much duplication between the various jobs that it's hard to keep
track of it manually. Let's employ a python script to generate those bits,
reducing the actual gitlab-ci.yml to the hand-written parts only.

The new script takes the .gitlab-ci/gitlab-ci.yml.in and simply appends the
generated parts to it. Most of it is straightforward, only centos needs some
custom parts because of missing doxygen.

The diff is a bit hard to review, thanks to the python script we now group
based on distribution, not based on name (i.e. all fedoras in one group
instead of all container-preps in one group).
And since we're generating anyway, some of the in-between stages were removed
(e.g. $DISTRO-build@template).

A new CI job is added to run a diff against the .gitlab-ci.yml that's checked
in and the one generated by this script. If they differ, we fail.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 14:23:18 +10:00
Peter Hutterer
3e0a9e084d gitlab CI: move a few sections around
Move the centos builds to after the ubuntu builds and swap the two fedora
builds. Just we have the same order for things here as in the container
prep/clean phases and to make a future patch easier to review.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 11:15:10 +10:00
Peter Hutterer
0dbcfed117 gitlab CI: visually align the container images
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-17 10:50:30 +10:00
Peter Hutterer
388644b22b Compress an if statement
No functional changes, just making the code slightly more compressed

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:44 +00:00
Peter Hutterer
50ebda0263 Localize two variables
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:44 +00:00
Peter Hutterer
6430694715 Uncomplicate the setting of axis during slot sync
A few bytes get wasted, but no magic handling of offsets etc are required.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:44 +00:00
Peter Hutterer
c04f5bcec0 Push the tracking id change bits on the stack
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:44 +00:00
Peter Hutterer
5501973320 Push the slot_update bits on the stack
Much simpler code this way

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:44 +00:00
Peter Hutterer
757f2d4900 Drop the mt_sync_state in our device struct
Replace it with a stack-allocated one. This saves us a bunch of confusing
allocations and size calculations.

And in the process use uint32_t/int32_t to ensure the struct is actually the
expected size.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-16 22:02:43 +00:00
Peter Hutterer
487d80a7fe gitlab CI: align the image tags a bit nicer
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 15:55:35 +10:00
Peter Hutterer
c001fe50b0 gitlab CI: rename the default_build to autotools_build
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:50:16 +10:00
Peter Hutterer
977891bd88 flake8 fixes for make-event-names.py
Mostly whitespace changes, two semicolon removals and one change to "foo is
None".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:50:16 +10:00
Peter Hutterer
4d4873d101 Change the python script to generate event names to Python3
It's well past time. If you need this to run on python2, patch it out locally.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:50:16 +10:00
Peter Hutterer
21ca8dba06 test: silence warnings about missing field initializers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:03:23 +10:00
Peter Hutterer
8666e6958d test: fix two signed vs unsigned warnings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:03:23 +10:00
Peter Hutterer
939076efc9 uinput: drop an unused function argument
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:03:23 +10:00
Peter Hutterer
3d03038d78 tools: drop explicit GNU_SOURCE define
It's defined globally through AC_USE_SYSTEM_EXTENSIONS

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:03:23 +10:00
Peter Hutterer
4c8a7a265d config.h is a local include path
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:03:23 +10:00
Peter Hutterer
0a66de813e tools: drop use of HAVE_CONFIG_H
There's no case where we don't have a config.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 12:03:23 +10:00
Peter Hutterer
201dfc38f9 gitlab CI: separate builddir from srcdir
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 11:49:37 +10:00
Peter Hutterer
ee2d35a90a gitlab CI: use extends over yaml anchors
This also gets rid of some superfluous inclusions - all those are inherited
now anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 09:03:11 +10:00
Peter Hutterer
6292354b44 gitlab CI: remove a reference to libinput
That's what you get for copy/paste...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 08:38:32 +10:00
Peter Hutterer
90ff5a0cae gitlab CI: add a check-commit stage
Taken from libinput, checks for signed-off-by and other things.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-14 08:30:29 +10:00
Peter Hutterer
9fec3228fb configure.ac: add a toggle to enable the special coverity options
Coverity tries to supply system headers and fails badly at it. A bunch of
_Float... sizes are pulled in by math.h but not provided anywhere. So as a
workaround, let's add an option to explicitly enable coverity support that
simply #defines those types to ones we do know about and let's go on hoping
it'll eventually work.

See the equivalent addition to libinput in commit 8178339b5baa717.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-12 22:12:03 +00:00
Peter Hutterer
25cddcecd3 Add queue_push_event as shortcut for the two-liner we use everywhere
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-12 21:41:15 +10:00
Peter Hutterer
0af21e0e74 Simplify some error handling by assuming a >=3.4 kernel
v3.4 was released in 2012, every kernel since has that ioctl. So instead of
assuming you're running new libevdev on an 8 year old kernel, let's assume
that any error from the ioctl() is an actual error and handle it accordingly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-11 21:07:06 +10:00
Peter Hutterer
4fc12638d2 test: slightly modernize some of the tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-11 20:57:42 +10:00
Peter Hutterer
58559d9fec test: provide a function to print an event
Easy to copy/paste into a test that needs a bit of debugging, otherwise unused.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-11 20:57:42 +10:00
Peter Hutterer
1014acedfc test: split the tests into one test case each
For debugging it's more important to be able to quickly run a single test
rather than grouping them together, we don't have thousands of tests here
anyway. So let's add a macro to put every test func into its own TCase,
allowing for test selection via the environment variable CK_RUN_CASE.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-11 20:57:42 +10:00
Peter Hutterer
2af0b94623 test: wrap the event checks into a macro
One-liner to check an event rather than three separate statements in every
test.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-11 20:57:42 +10:00
Peter Hutterer
28dbb3399a doc: add markdown for monospace rendering of defines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-11 20:46:14 +10:00
Michael Forney
1f1bd4e2ce Only use GCC pragma on GCC
Signed-off-by: Michael Forney <mforney@mforney.org>
2020-02-05 20:31:30 -08:00
Michael Forney
2f300eb6b5 Avoid initializer index range
This is a GNU C extension, and is not available in ISO C.

Instead, just explicitly initialize other indices to -1.

Signed-off-by: Michael Forney <mforney@mforney.org>
2020-02-05 20:31:30 -08:00
Michael Forney
06ef34c86b Add fallback min/max for compilers that don't have statement expressions
Statement expressions are a GNU C extension and are not available
in ISO C.

On compilers that don't have them, define these macros as plain
conditional expressions, since they are only ever used with expressions
that have no side-effects.

The statement-expression version is still retained as an added
safety measure on GNU-compatible compilers.

Signed-off-by: Michael Forney <mforney@mforney.org>
2020-02-05 20:30:39 -08:00
Peter Hutterer
e74ba891f7 test: add mangle_path to the excluded symbols leak list
Don't 100% know where it comes from but it's not ours, so...

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-06 10:36:17 +10:00
Peter Hutterer
6668e0fe21 gitlab CI: some more centos deduplication
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-06 10:25:05 +10:00
Peter Hutterer
5b97b970c0 gitlab CI: don't run distcheck on centos 7 anymore
With b65be7aa79 the centos 7 RPMs don't include doxygen anymore, so let's drop
the distcheck job. Centos 7 is old enough at this point that we don't need to
care too much.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-06 10:22:48 +10:00
Peter Hutterer
5b3659d468 gitlab CI: force a rebuild of all the docker containers
To make sure the current pipeline is correct

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-03 20:40:40 +10:00
Peter Hutterer
ff8a5b065c gitlab CI: switch the custom builds to Fedora 31
With b65be7aa79 the centos 7 RPMs don't include doxygen anymore, causing a CI
pipeline failure (but only where the centos image is being rebuilt).

Fedora is a better early-warning system about possible breakages than Centos -
which was originally chosen precisely because it doesn't update much and was
faster to run in the CI (this was before custom docker images).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-03 20:40:40 +10:00
Peter Hutterer
925b2aa26d test: replace the SW_LID tests with SW_HEADPHONE_INSERT
We're only testing EV_SW event delivery here and SW_LID has the tendency to
suspend the host when we don't specifically inhibit it. So let's just swap for
the next one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-18 13:45:18 +10:00
Peter Hutterer
b65be7aa79 CI: add a Centos 8 container build
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-15 14:47:50 +10:00
Peter Hutterer
864f0c6829 CI: deduplicate distcheck by making it a variable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-15 14:47:50 +10:00
Peter Hutterer
74d4a3d11d CI: move the configure flags into a variable
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-15 14:40:56 +10:00
Peter Hutterer
6c4981393e CI: extend the CI to work with containers
Mostly copy/paste from libinput but we do build on debian and centos as well.
The special builds are basically the same as before.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-25 00:17:46 +00:00
Peter Hutterer
9a5f44a605 make-event-names.py should take the files as argument
Don't rely on cat, just let our script read everything as required.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-10-23 03:13:50 +00:00
Alexander Dahl
2c6733fc67 doc: Fix function names in simple code example
That code did not compile because those functions were only renamed in
header and code back then, but not in the example.

Fixes: ab2f20bfd6 ("Revamp the API once again")
Signed-off-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-09-13 15:30:57 +10:00
Peter Hutterer
779749b22c libevdev 1.8.0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-26 14:35:54 +10:00
Peter Hutterer
fce16d51a8 include: sync event codes with kernel 5.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-26 14:33:19 +10:00
Nayan Deshmukh
a2bb53262f doc: add a note regarding truncation of id_* fields
The id_* fields are 16 bits in linux/input.h and we mirror
the kernel API here. Even though we accept an int for this
fields in ABI the value is truncated at 16 bits.

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-05 08:26:15 +10:00