Commit graph

813 commits

Author SHA1 Message Date
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
Peter Hutterer
442ce1edb8 proto: give a rough protocol overview as part of the docs 2023-03-07 11:33:35 +10:00
Peter Hutterer
4a3efa913a proto: more documentation improvements 2023-03-07 11:33:31 +10:00
Peter Hutterer
25e36eb24e meson: move the "build this?" checks into the subdirs
Let's decide on what to build in the doc/ and test/ directory rather
than in the main file.
2023-03-07 11:10:06 +10:00
Peter Hutterer
7810be8a80 meson: split into separate meson.build files for src/tools 2023-03-07 11:10:06 +10:00
Peter Hutterer
44295ab044 tools: add touch support to the ei-demo-client 2023-03-06 16:25:04 +10:00
Peter Hutterer
46bef9fe86 tools: add touchscreen support to the eis-demo-server 2023-03-06 16:11:55 +10:00
Peter Hutterer
8c2f51fcff tools: fix a debug message in the demo client 2023-03-06 16:11:53 +10:00
Peter Hutterer
ebd7d102cd proto: clarify that the ei_seat capabilities depend on ei_device
Regardless of the ei_seat version, ei_seat.bind will support all
capablities of the negotiated ei_device interface. This means we don't need
to bump ei_seat just to add a new capability to ei_device.
2023-03-06 14:57:18 +10:00
Peter Hutterer
717900f6fe Generate the protocol documentation in gitlab pages 2023-03-03 15:24:42 +10:00
Peter Hutterer
3d3b20f172 doc: add the templates and a script to generate hugo markdown
Intention here is to have the protocol in a readable manner somewhere.
Doxygen doesn't *quite* cut the bill.
2023-03-03 15:24:42 +10:00
Peter Hutterer
eb9fa07c10 scanner: add a filter to escape ei protocol names
By default escape them with backticks for markdown
2023-03-03 11:39:03 +10:00
Peter Hutterer
2fb1ff70e3 scanner: allow '-' for loading a template from stdin 2023-03-03 11:39:03 +10:00
Peter Hutterer
ea3ada1a80 proto: make the documentation an extractable set of XML tags
Instead of hiding this in a XML comment, let's make it a proper set of
tags so we can extract it and use it in generated documentation.
2023-03-03 11:38:40 +10:00
Peter Hutterer
c350ac2ee3 src: pass the headerfile as jinja extra data
This removes another special handling of the C bindings from the
scanner.
2023-03-03 11:38:40 +10:00
Peter Hutterer
d127f02f0a scanner: add ability to pass extra data to the jinja templates
This makes generation of files with the scanner a lot more flexible -
e.g. one can run the scanner with
  --jinja-extra-data='{ "interface": "ei_connection"}'
and then in the jinja template use an if condition to match on this
interface.
2023-03-03 11:38:40 +10:00
Peter Hutterer
2fa7792a33 scanner: drop duplicate import
We already import dedent globally
2023-03-03 11:27:01 +10:00
Peter Hutterer
2550a0b54d scanner: raise SystemExit instead of calling sys.exit
Bit nicer (no import sys required for that call) and that's what sys.exit
does that anyway.
2023-03-03 11:27:01 +10:00
Peter Hutterer
70e2a9fbc2 protocol: fix two cross-references 2023-03-03 11:27:01 +10:00
Peter Hutterer
5f9bfe7b7b client: drop seats when destroying the client
This *should* have happened when the client got disconnected but in some
race conditions a seat may be added after the client gets disconnected.
Reproducible (sometimes) by test_invalid_object_id with the
eis-demo-server:
- client connects, sends invalid object ID, gets disconnected
- server sees CONNECTED, adds a seat, then sees DISCONNECTED and drops
  the client.

From the demo-server's POV the seat is handled by the client, so it
expects the client to destroy it.
2023-03-03 11:27:01 +10:00
Peter Hutterer
3c589f1b20 test: log all function calls to interfaces
Makes debugging easier to see exactly who's being called.
2023-03-03 11:27:01 +10:00
Peter Hutterer
59542a1ba0 test: group 4 bytes at a time in our hexlify function
Our protocol is groups of 4s, so make it easier to find individual items
in the hexdump.
2023-03-03 11:27:01 +10:00
Peter Hutterer
9700a47473 test: run pytest with xdist where available
A lot of the protocol tests have enforced timeouts because we need to
wait for the server to do something (or not). Running the protocol tests
with xdist means we can run those in parallel, which on my local box
roughly halves the time required to run all protocol tests.

Of course, this is all terrible. The only way to tell pytest to use
xdist is with `pytest -n <jobcount>`. But -n is only available if xdist
is installed. Dynamically adding commandline options is supposed to
be possible with `pytest_load_initial_conftests` in conftest.py, but
that doesn't actually work unless we're configuring a setuptool plugin.
Which we don't. What would work is `pytest_cmdline_preparse` but that
has been deprecated.

So we work around this by having meson check if xdist is available and
append `-n auto` for us.

In the CI let's be nice and only use the FDI_CI_CONCURRENT number of
jobs rather than hogging everything available. And, continuation from
"all is terrible": pytest complains if you have a hook that's unknown.
So if xdist is not available, you must not have the hook in conftest.py.
Which means we have to do it within an import + ImportError clause.

But yay, now we're saving literally seconds!
2023-03-03 11:27:01 +10:00
Peter Hutterer
bbc64b2eff CI: explicitly add ei-proto to the ruff check 2023-03-03 11:27:01 +10:00
Peter Hutterer
ba8bead183 meson.build: add black and ruff checks to the test suite
We still have the separate CI jobs for those (for better visibility) but
also optionally incorporate those into the meson test run.

Both calls only check the files, they do not modify anything.
2023-03-03 11:27:01 +10:00
Peter Hutterer
a806968ec5 test: up the timeout for dispatch
10ms isn't enough, esp. when running under valgrind
2023-03-03 11:27:01 +10:00