Commit 4c8419b9 authored by Hake Huang's avatar Hake Huang Committed by Henrik Brix Andersen
Browse files

twsiter: binary handler: pass verbose setting to west call

pass verbose setting to west call. when the v > 2 west log
will be triggerred

Signed-off-by: default avatarHake Huang <hake.huang@nxp.com>
parent 5bef4a9d
Loading
Loading
Loading
Loading
+4 −1
Changes for scripts/pylib/twister/twisterlib/handlers.py: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -583,7 +583,10 @@ class DeviceHandler(Handler):
        if self.options.flash_command:
            return self._create_flash_command(hardware)

        command = ["west", "flash", "--skip-rebuild", "-d", self.build_dir]
        command = ["west"]
        if self.options.verbose > 2:
            command.append(f"-{'v' * (self.options.verbose - 2)}")
        command += ["flash", "--skip-rebuild", "-d", self.build_dir]
        command_extra_args = []

        # There are three ways this option is used.
+5 −3
Changes for scripts/tests/twister/test_handlers.py: 5 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -1187,7 +1187,7 @@ def test_devicehandler_create_command(
):
    handler = DeviceHandler(mocked_instance, 'build', mock.Mock())
    handler.options = mock.Mock(west_flash=self_west_flash,
                                flash_command=self_flash_command)
                                flash_command=self_flash_command, verbose=0)
    handler.generator_cmd = 'generator_cmd'

    expected = [handler.build_dir if val == '$build_dir' else \
@@ -1453,7 +1453,8 @@ def test_devicehandler_handle(
    handler.options = mock.Mock(
        timeout_multiplier=1,
        west_flash=None,
        west_runner=None
        west_runner=None,
        verbose=0
    )
    handler._start_serial_pty = mock.Mock(side_effect=mock_start_serial_pty)
    handler._create_command = mock.Mock(return_value=['dummy', 'command'])
@@ -2027,7 +2028,8 @@ def test_qemuhandler_handle(
    handler.options = mock.Mock(
        timeout_multiplier=1,
        west_flash=handler_options_west_flash,
        west_runner=None
        west_runner=None,
        verbose=0,
    )
    handler.run_custom_script = mock.Mock(return_value=None)
    handler.make_device_available = mock.Mock(return_value=None)