Commit graph

838 commits

Author SHA1 Message Date
Peter Hutterer
1a4764d99b libei 0.5 2023-04-06 14:19:22 +10:00
Peter Hutterer
f15736e809 scanner: add a validator for Interface.mode
Not really needed since we currently have an assert in create but this
makes the code more obvious.
2023-04-06 14:01:07 +10:00
Peter Hutterer
3546a443a9 scanner: auto-mangle the interface name when accessed
Now that we only have one place where we need to mangle the name, let's
make this a property of the Interface instead.
2023-04-06 14:00:44 +10:00
Peter Hutterer
cfd2980ae4 scanner: look up interfaces by protocol name
Now that we have it, let's use it instead having to mangle names.
2023-04-06 13:57:20 +10:00
Peter Hutterer
24680aef2e test: use an enum iterator to loop through the interface names 2023-04-06 13:57:20 +10:00
Peter Hutterer
5aad9fd777 scanner: add the protocol name so we can compile some #defines
The protocol name on an interface is a fixed string that is part of
the ABI since it's used in a few messages (e.g.
ei_handshake.interface_version). To avoid typos, let's expose that
string in the scanner and #define it in the generated sources.
2023-04-06 13:57:20 +10:00
Peter Hutterer
fa07430683 scanner: use mangle_name for the interface name 2023-04-06 13:57:20 +10:00
Peter Hutterer
99b36ba652 test: add a test for pointer vs abs pointer receiving 2023-04-06 13:57:20 +10:00
Peter Hutterer
7f7880d953 test: add test for receiving the device interfaces 2023-04-06 13:57:20 +10:00
Peter Hutterer
5b1b5aec1a proto: replace pointer/keyboard/touchscreen with a generic "interface" event
Since these events are merely notifications of a single object, we can make
this more generic. This allows us to introduce future capabilities without
having to bump the seat.
2023-04-06 13:57:18 +10:00
Peter Hutterer
4b77664dc1 test: if we fail to load liboeffis.so, skip the rest of the pytests
This gives us a nicer behavior when (semi-intentionally) running pytest
in the source directory.
2023-04-06 12:04:51 +10:00
Peter Hutterer
6179c91580 test: fix the exception check for the missing eiproto module
When running pytest from the source directory we get a
ModuleNotFoundError, not an ImportError.
2023-04-06 12:04:35 +10:00
Peter Hutterer
0aa8bab9c0 test: drop the default timeouts to 2
There's no need to wait any longer.
2023-04-05 14:22:31 +10:00
Salman Malik
a438e46e18 config: Make memfd_create optional
`memfd_create` doesn't seem to be supported on
all platforms (e.g. ubuntu 18 has trouble with it).
Even though, I was able to substitute `memfd_create`
with a direct system call, I was not able to get
the `MFD_CLOXEC` flag (from fcntl.h) working cleanly
(there were redefinitions/conflicts for other
structures when trying to use <linux/*> headers).
Making it optional for time being till we have
figured out how to make it work broadly.
2023-03-28 11:24:06 +00:00
Salman Malik
8b7fb73bfd ei-scanner: Adjust annotation for list
Otherwise Python complains about:

TypeError: 'type' object is not subscriptable
2023-03-25 23:00:41 +00:00
Peter Hutterer
5332124abf CI: add a debian bullseye job 2023-03-19 07:56:09 +00:00
Peter Hutterer
74ed569fe0 test: skip the oeffis tests if we don't have dbusmock 0.28.5 2023-03-19 07:56:09 +00:00
Peter Hutterer
bba921329d proto: skip the bitmask check if on old python versions
int.bit_count() requires Python 3.10, so let's skip it where not
available.
2023-03-19 07:56:09 +00:00
Peter Hutterer
a95c9e1799 meson: drop version requirement to 0.56 so we can build on Bullseye
Looks like the only more recent meson feature we use is for
'exclude_suites' in the valgrind test setup. We can just skip that.
2023-03-19 07:56:09 +00:00
Peter Hutterer
c5aa2c0b60 doc/proto: address a few documentation issues
A few clarifications as suggested by Benjamin Tissoires.
2023-03-17 14:03:32 +10:00
Salman Malik
150ac5b4ac src/meson.build: Switch shared_library => library
This is the recommendation from meson documentation. The default
option is still to create a shared library but doing it this
way gives users an opportunity to create either a shared, static
or both type of libraries by setting up the meson build appropriately.

Here is the result with the default setup:

$ meson setup . _build
$ meson compile -C _build
$ find _build | egrep "(\.so|\.a)$"

_build/subprojects/munit/libmunit.so
_build/test/libunittest.a
_build/test/libeierpecken.a
_build/src/libei.so
_build/src/liboeffis.so
_build/src/libutil.a
_build/src/libeis.so

And here it is with the overridden flag:

_build/subprojects/munit/libmunit.a
_build/test/libunittest.a
_build/test/libeierpecken.a
_build/src/libei.a
_build/src/libeis.a
_build/src/liboeffis.a
_build/src/libutil.a

$ meson setup . _build  --default-library=static
$ meson compile -C _build
$ find _build | egrep "(\.so|\.a)$"
2023-03-15 00:47:15 +00:00
Peter Hutterer
1bc04bffa8 CI: add new workflow rules
Required for pipelines to run after some infrastructure changes, see
See https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/438
2023-03-15 09:47:14 +10:00
Peter Hutterer
e6cb6b1998 Add a pre-commit hook
Moving my local hooks into a pre-commit hook set that others can find
useful too:
- remove trailing whitespaces and newlines
- don't allow commits to the "main" branch
- python black and python ruff (same args as in the CI)
2023-03-13 08:52:08 +10:00
Peter Hutterer
8954d96227 Remove empty trailing newlines from all files 2023-03-13 08:52:08 +10:00
Peter Hutterer
940f2778a9 CI: bump to the latest ci templates
This version includes a fix for ci-fairy to handle the trailing newlines
in a more predictable manner.
2023-03-13 08:51:52 +10:00
Peter Hutterer
37f4351a67 doc/proto: add a page for the ei-scanner
In case someone is actually planning to use that one
2023-03-10 14:25:59 +10:00
Peter Hutterer
d44de4e73e doc/proto: add a link to the git repo and issues page 2023-03-09 14:49:03 +10:00
Peter Hutterer
e8765f3042 doc/proto: add a page describing the libraries
Now that the API doc is behind a link, let's make it a bit more
prominent to find.
2023-03-09 14:28:30 +10:00
Peter Hutterer
2665224461 doc/proto: mirror the required directory structure
Might as well make this easier for us locally.
2023-03-09 14:28:30 +10:00
Peter Hutterer
3bcece1923 doc/proto: remove now unused files
Obsolete since 5258a559eb:
    doc/proto: remove the embedded docs from the proto, use static pages instead
2023-03-09 13:43:43 +10:00
Peter Hutterer
6b7424e821 doc/proto: fix a bug with the pages script
Removing the chapter pages means the directory no longer exists, so we
manually have to mkdir it.
2023-03-08 16:07:00 +10:00
Peter Hutterer
5258a559eb doc/proto: remove the embedded docs from the proto, use static pages instead 2023-03-08 11:09:58 +10:00
Peter Hutterer
56004836b9 proto: add the context-type attribute to events and requests
This allows us to mark/filter requests and events that are only
available on a given context type.
2023-03-08 09:01:03 +10:00
Peter Hutterer
fb5b607c13 doc/proto: put a standard blurb in for the destructor-type requests
Should eventually have a separate protocol documentation section for
this and point to it, but this will do for now.
2023-03-07 19:29:27 +10:00
Peter Hutterer
59ab84669f doc/proto: add some basic index pages
Better than the placeholders...
2023-03-07 19:22:00 +10:00
Peter Hutterer
ef430fceb0 doc/proto: add the generator script to the input files
So meson tracks the dependency better
2023-03-07 19:07:46 +10:00
Peter Hutterer
f97aa73c7c doc/proto: sort pages by occurrence in the protocol file 2023-03-07 19:05:52 +10:00
Peter Hutterer
f4f6dabbe2 proto: fix references to ei_handshake.interface_version 2023-03-07 18:58:58 +10:00
Peter Hutterer
3b30c38a39 protocol: more protocol documentation 2023-03-07 15:26:36 +10:00
Peter Hutterer
b05b256fd8 scanner: expand the regex to search for protocol names
This now finds nested ei_foo.bar.baz too (though it includes the
trailing full stop, if any).
2023-03-07 15:26:36 +10:00
Peter Hutterer
4ac13ac7a7 CI: fix the doxygen path
Adding the mkdir means we copy into that directory.
2023-03-07 15:26:36 +10:00
Peter Hutterer
8fad365f37 doc: split protocol and api builds into separate meson options 2023-03-07 15:26:36 +10:00
Peter Hutterer
2cf6df9cd0 meson: hook up the protocol documentation via meson
Since we want the generated documentation to be useful on-disk, drop the
baseURL and switch to relativeURLs = true for hugo.

This is arguably a bit nasty in that it git clones the theme into the
build directory. But oh well...
2023-03-07 14:14:58 +10:00
Peter Hutterer
248d08c6a5 doc: drop the doxygen protocol generation
This is better done with a separate system (e.g. hugo) and it's pretty
awful to read anyway.
2023-03-07 13:18:41 +10:00
Peter Hutterer
872e256759 doc: move the API documentation into its own directory 2023-03-07 13:17:12 +10:00
Peter Hutterer
d936e3e822 meson: make the header files variables to use within other meson files 2023-03-07 13:17:12 +10:00
Peter Hutterer
30aab5179e Merge branch 'main' into wip/drop-protobuf 2023-03-07 12:55:18 +10:00
Peter Hutterer
449d808b42 CI: always run the tests
Embarassingly, only the valgrind test would actually run tests because
it was the only one with a non-null MESON_TEST_ARGS. Let's fix this by
explicitly telling the build script to run the tests.
2023-03-07 11:57:46 +10:00
Peter Hutterer
367fa6384f test: fix the LD_LIBRARY_PATH to liboeffis
Make this dependent on liboeffis directly instead of hardcoding where it
should be.
2023-03-07 11:54:10 +10:00
Peter Hutterer
a2e60be0e6 meson: fix a typo 2023-03-07 11:50:09 +10:00