diff --git a/scripts/pylib/twister/twisterlib/handlers.py b/scripts/pylib/twister/twisterlib/handlers.py index a89e82b1bb1..d9f1943e1c3 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -467,6 +467,8 @@ class DeviceHandler(Handler): def handle(self, harness): runner = None hardware = self.get_hardware() + if hardware: + self.instance.dut = hardware.id if not hardware: return diff --git a/scripts/pylib/twister/twisterlib/reports.py b/scripts/pylib/twister/twisterlib/reports.py index 0d93eaf6227..bd005d4319a 100644 --- a/scripts/pylib/twister/twisterlib/reports.py +++ b/scripts/pylib/twister/twisterlib/reports.py @@ -273,6 +273,8 @@ class Reporting: suite['retries'] = instance.retries + if instance.dut: + suite["dut"] = instance.dut if available_ram: suite["available_ram"] = available_ram if available_rom: diff --git a/scripts/pylib/twister/twisterlib/runner.py b/scripts/pylib/twister/twisterlib/runner.py index 2d880590334..28b920e077c 100644 --- a/scripts/pylib/twister/twisterlib/runner.py +++ b/scripts/pylib/twister/twisterlib/runner.py @@ -932,6 +932,8 @@ class ProjectBuilder(FilterBuilder): if instance.handler.ready and instance.run: more_info = instance.handler.type_str htime = instance.execution_time + if instance.dut: + more_info += f": {instance.dut}," if htime: more_info += " {:.3f}s".format(htime) else: diff --git a/scripts/pylib/twister/twisterlib/testinstance.py b/scripts/pylib/twister/twisterlib/testinstance.py index 4632de8c2b6..ccfc3cd06d4 100644 --- a/scripts/pylib/twister/twisterlib/testinstance.py +++ b/scripts/pylib/twister/twisterlib/testinstance.py @@ -54,6 +54,7 @@ class TestInstance: self.name = os.path.join(platform.name, testsuite.name) self.run_id = self._get_run_id() + self.dut = None self.build_dir = os.path.join(outdir, platform.name, testsuite.name) self.domains = None