Esempio n. 1
0
    def test_shell_interpreter(self):
        """ Test a shell with a custom interpreter """
        platform = self.dbg.GetSelectedPlatform()
        self.assertTrue(platform.IsValid())

        sh_cmd = lldb.SBPlatformShellCommand('/bin/zsh', 'echo $0')
        self.assertIn('/bin/zsh', sh_cmd.GetShell())
        self.assertIn('echo $0', sh_cmd.GetCommand())

        self.build()
        sh_cmd.SetShell(self.getBuildArtifact('a.out'))
        err = platform.Run(sh_cmd)
        self.assertSuccess(err)
        self.assertIn("SUCCESS", sh_cmd.GetOutput())
Esempio n. 2
0
 def run_platform_command(self, cmd):
     platform = self.dbg.GetSelectedPlatform()
     shell_command = lldb.SBPlatformShellCommand(cmd)
     err = platform.Run(shell_command)
     return (err, shell_command.GetOutput())