From 4e4b743fe12266135b9e808215bb415a059b06d9 Mon Sep 17 00:00:00 2001 From: Maciej Perkowski Date: Wed, 6 Sep 2023 16:52:16 +0200 Subject: [PATCH] twister: Add "path" entry to json test report "Path" is a path (relative to zephyr) to a directory with test suite's definition. Such entry helps to locate a given test. Signed-off-by: Maciej Perkowski --- scripts/pylib/twister/twisterlib/reports.py | 1 + scripts/pylib/twister/twisterlib/testsuite.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/scripts/pylib/twister/twisterlib/reports.py b/scripts/pylib/twister/twisterlib/reports.py index bd005d4319a..0b34a5d309b 100644 --- a/scripts/pylib/twister/twisterlib/reports.py +++ b/scripts/pylib/twister/twisterlib/reports.py @@ -258,6 +258,7 @@ class Reporting: "name": instance.testsuite.name, "arch": instance.platform.arch, "platform": instance.platform.name, + "path": instance.testsuite.source_dir_rel } if instance.run_id: suite['run_id'] = instance.run_id diff --git a/scripts/pylib/twister/twisterlib/testsuite.py b/scripts/pylib/twister/twisterlib/testsuite.py index bdd681699ff..71dd9b493c9 100644 --- a/scripts/pylib/twister/twisterlib/testsuite.py +++ b/scripts/pylib/twister/twisterlib/testsuite.py @@ -395,6 +395,8 @@ class TestSuite(DisablePyTestCollectionMixin): self.id = name self.source_dir = suite_path + self.source_dir_rel = os.path.relpath(os.path.realpath(suite_path), + start=canonical_zephyr_base) self.yamlfile = suite_path self.testcases = []