Commit graph

387 commits

Author SHA1 Message Date
Mario Limonciello
27a8dfc8e7 Show a summary at end of meson setup 2024-02-15 09:26:13 -06:00
Mario Limonciello
e9f26f965f Convert pylint to a meson feature
Enable by default if it's found.
2024-02-15 09:26:13 -06:00
Mario Limonciello
3d509fa6d2 Generate bash-completion and zsh-completion using shtab 2024-02-15 09:26:13 -06:00
Mario Limonciello
9a3b379b11 fix typo in meson_options.txt 2024-02-15 09:26:13 -06:00
Marco Trevisan (Treviño)
d225c197e8 build: Bump dependency on polkit-gobject-1 0.99
It's still old enough to work on old distros, but it's what debian's
automatic dependencies system (based on library exported symbols) tells
us, so we should trust it!
2024-02-15 06:10:18 +01:00
Marco Trevisan (Treviño)
55e17d7bfe ci: Install python3-argparse-manpage and require building manpage 2024-02-15 04:55:04 +01:00
Marco Trevisan (Treviño)
7858623142 powerprofilectl: Generate manpage using argparse-manpage
Add an option to toggle this feature so that it can be either
required or not
2024-02-15 04:55:04 +01:00
Marco Trevisan (Treviño)
7cd764c075 build: Expose powerprofilesctl script and load it using files 2024-02-15 04:32:58 +01:00
Marco Trevisan (Treviño)
1ca46967b2 tests: Ensure daemon is ready before launching the test client 2024-02-15 01:30:26 +01:00
Marco Trevisan (Treviño)
fce98c6395 powerprofilesctl: Avoid uneeded raise, this will happen anyways 2024-02-15 01:26:33 +01:00
Marco Trevisan (Treviño)
47a155407f tests: wait more for valgrind-running daemon
In CI we may need to wait for it more than 10 seconds, so second this.
2024-02-15 01:26:29 +01:00
Mario Limonciello
0d3030b610 Bump version to 0.20 2024-02-15 00:36:59 +01:00
Mario Limonciello
9f9f7ca7ac README.md: Add documentation to block driver or action loading 2024-02-15 00:36:59 +01:00
Mario Limonciello
126f7d3a54 README.md: Add documentation for panel power savings 2024-02-15 00:36:59 +01:00
Mario Limonciello
cf243d97db README.md: Clarify that multiple drivers can be loaded 2024-02-15 00:36:59 +01:00
Marco Trevisan (Treviño)
5937b84df7 ci: Bump number of inotify user instances
We had errors due to limited number of values
2024-02-15 00:36:59 +01:00
Marco Trevisan (Treviño)
1e5e0972c8 ci: Cleanup installation script 2024-02-15 00:24:55 +01:00
Marco Trevisan (Treviño)
5ed52c8cd0 ci: Use tmpdir in the build path as temporary path
As in commit b028f276 tmpfs may be limited, leading us to problems in
some tests.

And having this seems to solve a timeout issue we may have under
valgrind in CI.
2024-02-15 00:14:19 +01:00
Marco Trevisan (Treviño)
1c48162ea1 tests: Assert launched client exits with no error 2024-02-15 00:02:09 +01:00
Marco Trevisan (Treviño)
e69c0455a7 power-profiles-daemon: Cleanup syntax of drivers selection 2024-02-14 23:32:43 +01:00
Marco Trevisan (Treviño)
3c037f1c74 ppd-driver: Clear performance degraded value on finalize
We were missing this, thus leaking.
2024-02-14 23:32:43 +01:00
Marco Trevisan (Treviño)
4ece7c2bf2 power-profiles-daemon: Use autopointer to manage created drivers
We were manually handling the created divers/actions objects, but we did
did not cover all the cases we needed to unref them, leading to a leak.

To prevent this, use autopointers that will make everything easier to
handle.
2024-02-14 23:32:43 +01:00
Marco Trevisan (Treviño)
e1c83e8b27 tests: Ensure the daemon exits with no error
We did terminate the daemon and waited for it, but we did not ensure
that it was terminated with no error.

This is particularly a problem when we are running the sanitizers or
valgrind, because we didn't catch any error.

Thus... We were living with some leaks that we never caught :)
2024-02-14 23:32:38 +01:00
Marco Trevisan (Treviño)
d1a6e92582 build: Add check parameter to run_command()
This handles a meson warning
2024-02-14 22:07:30 +00:00
Marco Trevisan (Treviño)
e229030c34 ci: Build sanitizers builds in debug mode 2024-02-14 22:07:30 +00:00
Marco Trevisan (Treviño)
314ae0e7c8 ci: Explicitly list the coverage report and expose it in MRs 2024-02-14 22:07:30 +00:00
Marco Trevisan (Treviño)
b27fa341ec tests: Stop the daemon using termination
This implies a SIGTERM, and so will trigger the daemon clean teardown,
making it exit correctly.

In this way the coverage data is correctly generated, making finally our
coverage reports to be real!

Fixes: #137
2024-02-14 22:07:30 +00:00
Marco Trevisan (Treviño)
ccade23e30 power-profiles-daemon: Use autopointer to handle PpdApp data
In this way we always free it. Not just on successful exit.
2024-02-14 22:07:30 +00:00
Marco Trevisan (Treviño)
a0ff4af7ef power-profiles-manager: Exit cleanly on SIGTERM and SIGINT
In case we get a SIGINT or SIGTERM signal, quit the main loop so that we
perform all the teardown operations, including notifying clients and cleaning
up all the allocated resources.
2024-02-14 22:07:30 +00:00
Marco Trevisan (Treviño)
37bf20bb55 tests: Show full logs if PPD_TEST_VERBOSE env is set and use it in meson
It can be useful to inspect the daemon logs in any case, so let's show
the logs details when running in meson.

Then it's up to use the `--verbose` parameter to decide whether to see
them or to inspect them from the generated logs.
2024-02-14 21:33:05 +00:00
Mario Limonciello
940c262b74 amdgpu: reduce panel_power_saving values
The loss of color fidelity in battery mode is too dramatic, especially
with dark content (such as GNOME in dark mode or a dark background terminal).
2024-02-14 13:41:22 -06:00
Marco Trevisan (Treviño)
2a36abda82 tests: Add utility function to eventually check active profile 2024-02-14 19:43:43 +01:00
Marco Trevisan (Treviño)
d174b46498 tests: Simplify files writing
Avoid repeating the same pattern everywhere, just do it once with an
utility function.
2024-02-14 19:36:29 +01:00
Marco Trevisan (Treviño)
a1d8585aec tests: Wait for file contents to match expected ones
Daemon may take some moments to do IO operations, and the tests
may be too fast in reading this.

As per previous cleanups this become a problem when testing in
slower scenarios (as valgrind), so take the opportunity to
cleanup the tests so that we always wait for file contents to
match the expected one.
2024-02-14 19:36:29 +01:00
Marco Trevisan (Treviño)
14edcbfd89 tests: Simplify assert_eventually() using GLib.Timeout
Also use milliseconds instead of deciseconds.
2024-02-14 18:37:24 +01:00
Marco Trevisan (Treviño)
6cf48b4a42 tests: Use python unittest assertions instead of native ones 2024-02-14 17:47:36 +01:00
Marco Trevisan (Treviño)
a518f333e0 tests: Avoid creating a new proxy for each dbus call
Just use the previously allocated, and do not cache anything on it
2024-02-14 17:47:36 +01:00
Marco Trevisan (Treviño)
b75275c757 power-profiles-daemon: Add debug info when the bus names are aquired 2024-02-14 17:38:39 +01:00
Marco Trevisan (Treviño)
867af41ab8 tests: Also ensure that the powerprofilesctl commands match with daemon 2024-02-14 17:38:39 +01:00
Mario Limonciello
13c4202fc7 tests: drop unused read_file() method 2024-02-14 10:37:17 -06:00
Mario Limonciello
e1c0a48b2c tests: Add integration tests to scrape the output of powerprofilesctl 2024-02-14 10:37:15 -06:00
Mario Limonciello
18a9c66681 Use python argparse and decorators instead of reinventing both 2024-02-14 10:37:14 -06:00
Mario Limonciello
718fde54d2 Don't modify powerprofilesctl at build time
Python version and binary used at build time might not be the same
as the installed OS.  Instead reference python3 from environment.
2024-02-14 00:03:31 -06:00
Mario Limonciello
c750f7e791 Reformat powerprofilesctl.in with black 2024-02-14 00:03:31 -06:00
Mario Limonciello
ba2cf0d6f8 Add a Version property and read it with powerprofilesctl 2024-02-14 00:03:28 -06:00
Marco Trevisan (Treviño)
40f3361473 power-profiles-daemon: Emit ProfileReleased when an holder is released
We used to send the signal only when cleaning up the holders, but we
should notify them also when an holder has been released for whatever
reason.
2024-02-14 05:17:49 +00:00
Marco Trevisan (Treviño)
91e907e11f power-profiles-daemon: Emit requester released signal on matching iface/path 2024-02-14 05:17:49 +00:00
Marco Trevisan (Treviño)
07132892f0 tests: Ensure that properties changed events are emitted 2024-02-14 05:17:49 +00:00
Mario Limonciello
e5b107a625 Send signals on both interfaces
Some clients (notably GNOME) look specifically for both the path and
interface.  To avoid breaking them on profile change events make sure
to emit signals on both the legacy and modern interface.
2024-02-14 05:17:49 +00:00
Marco Trevisan (Treviño)
f88ba64d1e ci: Add valgrind job 2024-02-14 04:27:39 +01:00