From 37bf20bb553cd40cdfae54ad055fed89fee0032a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 14 Feb 2024 21:12:49 +0100 Subject: [PATCH] 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. --- tests/integration_test.py | 4 +++- tests/meson.build | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration_test.py b/tests/integration_test.py index 42a142a..9841a68 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -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()) diff --git a/tests/meson.build b/tests/meson.build index cd8dcf3..dbc4183 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -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())