Commit b28b6a06 authored by Anas Nashif's avatar Anas Nashif Committed by Carles Cufi
Browse files

twister: print dut name when testing on hardware



When using the hardware map and testing on device, print out the name of
the dut (from the hardware map) on the script and report it in the json
output as well.

Signed-off-by: default avatarAnas Nashif <anas.nashif@intel.com>
parent b48c3cd3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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

+2 −0
Original line number Diff line number Diff line
@@ -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:
+2 −0
Original line number Diff line number Diff line
@@ -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:
+1 −0
Original line number Diff line number Diff line
@@ -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