Commit 57d5717b authored by Martí Bolívar's avatar Martí Bolívar Committed by Anas Nashif
Browse files

scripts: runner: let users copy/paste failed commands



Print a copy/pastable version of any command which fails, to help
debugging.

Signed-off-by: default avatarMarti Bolivar <marti@opensourcefoundries.com>
parent ad8b006b
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -412,7 +412,11 @@ class ZephyrBinaryRunner(abc.ABC):
        '''
        if self.debug:
            print(quote_sh_list(cmd))
        try:
            subprocess.check_call(cmd)
        except subprocess.CalledProcessError:
            print('Error running {}'.format(quote_sh_list(cmd)))
            raise

    def check_output(self, cmd):
        '''Subclass subprocess.check_output() wrapper.
@@ -423,7 +427,11 @@ class ZephyrBinaryRunner(abc.ABC):
        '''
        if self.debug:
            print(quote_sh_list(cmd))
        try:
            return subprocess.check_output(cmd)
        except subprocess.CalledProcessError:
            print('Error running {}'.format(quote_sh_list(cmd)))
            raise

    def popen_ignore_int(self, cmd):
        '''Spawn a child command, ensuring it ignores SIGINT.