1""" 2Test lldb's handling of job control signals (SIGTSTP, SIGCONT). 3""" 4 5 6from lldbsuite.test.lldbtest import * 7from lldbsuite.test.lldbpexpect import PExpectTest 8 9 10class JobControlTest(PExpectTest): 11 12 mydir = TestBase.compute_mydir(__file__) 13 14 def test_job_control(self): 15 def post_spawn(): 16 self.child.expect("PID=([0-9]+)") 17 self.lldb_pid = int(self.child.match[1]) 18 19 run_under = [sys.executable, self.getSourcePath('shell.py')] 20 self.launch(run_under=run_under, post_spawn=post_spawn) 21 22 os.kill(self.lldb_pid, signal.SIGTSTP) 23 self.child.expect("STATUS=([0-9]+)") 24 status = int(self.child.match[1]) 25 26 self.assertTrue(os.WIFSTOPPED(status)) 27 self.assertEquals(os.WSTOPSIG(status), signal.SIGTSTP) 28 29 os.kill(self.lldb_pid, signal.SIGCONT) 30 31 self.child.sendline("quit") 32 self.child.expect("RETURNCODE=0") 33