mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2026-05-08 12:28:05 +02:00
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.
This commit is contained in:
parent
940c262b74
commit
37bf20bb55
2 changed files with 4 additions and 1 deletions
|
|
@ -142,7 +142,9 @@ class Tests(dbusmock.DBusTestCase):
|
|||
|
||||
def run(self, result=None):
|
||||
super().run(result)
|
||||
if result and len(result.errors) + len(result.failures) > 0 and self.log:
|
||||
if not result or not self.log:
|
||||
return
|
||||
if len(result.errors) + len(result.failures) or os.getenv("PPD_TEST_VERBOSE"):
|
||||
with open(self.log.name, encoding="utf-8") as tmpf:
|
||||
sys.stderr.write("\n-------------- daemon log: ----------------\n")
|
||||
sys.stderr.write(tmpf.read())
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
envs = environment()
|
||||
envs.set('PPD_TEST_VERBOSE', 'true')
|
||||
envs.set ('top_builddir', meson.project_build_root())
|
||||
envs.set ('top_srcdir', meson.project_source_root())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue