2 Test lldb's handling of job control signals (SIGTSTP, SIGCONT).
5 from lldbsuite
.test
.decorators
import *
6 from lldbsuite
.test
.lldbtest
import *
7 from lldbsuite
.test
.lldbpexpect
import PExpectTest
10 class JobControlTest(PExpectTest
):
11 @skipIf(oslist
=["linux"], archs
=["arm", "aarch64"])
12 def test_job_control(self
):
14 self
.child
.expect("PID=([0-9]+)")
15 self
.lldb_pid
= int(self
.child
.match
[1])
17 run_under
= [sys
.executable
, self
.getSourcePath("shell.py")]
18 self
.launch(run_under
=run_under
, post_spawn
=post_spawn
)
20 os
.kill(self
.lldb_pid
, signal
.SIGTSTP
)
21 self
.child
.expect("STATUS=([0-9]+)")
22 status
= int(self
.child
.match
[1])
24 self
.assertTrue(os
.WIFSTOPPED(status
))
25 self
.assertEquals(os
.WSTOPSIG(status
), signal
.SIGTSTP
)
27 os
.kill(self
.lldb_pid
, signal
.SIGCONT
)
29 self
.child
.sendline("quit")
30 self
.child
.expect("RETURNCODE=0")