Commit Graph

3 Commits

Author SHA1 Message Date
Philip Withnall
e3f80b9254 gdbus-codegen: Emit GUnixFDLists if an arg has type h w/ min-version
This is a reimplementation of commit
4aba03562b from Will Thompson, but
conditional on the caller passing `--glib-min-version 2.64` to
`gdbus-codegen` to explicitly opt-in to the new behaviour.

From the commit message for that commit:

Previously, if a method was not annotated with org.gtk.GDBus.C.UnixFD
then the generated code would never contain GUnixFDList parameters, even
if the method has 'h' (file descriptor) parameters. However, in this
case, the generated code is essentially useless: the method cannot be
called or handled except in degenerate cases where the file descriptors
are missing or ignored.

Check the argument types for 'h', and if present, generate code as if
org.gtk.GDBus.C.UnixFD annotation were specified.

Includes a unit test too.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #1726
2019-12-11 10:40:07 +00:00
Philip Withnall
90f0733858 gdbus-codegen: Add a --glib-min-version argument
This can be used by callers to opt-in to backwards-incompatible changes
to the behaviour or output of `gdbus-codegen` in future. This commit
doesn’t introduce any such changes, though.

Documentation and unit tests included.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1726
2019-12-11 10:40:07 +00:00
Philip Withnall
41cabfaa98 tests: Add tests for the gdbus-codegen executable
Add a Python-based test wrapper for the `gdbus-codegen` executable,
similar to the existing tests for `glib-mkenums` and friends.

Add a few basic tests to begin with, but this doesn’t approach anywhere
near full coverage.

The next step is to move the existing Meson-based `gdbus-codegen` tests
from `gio/tests/meson.build` into the Python test suite.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Helps: #1612
2019-12-02 14:27:11 +00:00