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(macos_version
=["<", "14.0"], asan
=True)
12 @skipIf(oslist
=["linux"], archs
=["arm", "aarch64"])
13 def test_job_control(self
):
15 self
.child
.expect("PID=([0-9]+)")
16 self
.lldb_pid
= int(self
.child
.match
[1])
18 run_under
= [sys
.executable
, self
.getSourcePath("shell.py")]
19 self
.launch(run_under
=run_under
, post_spawn
=post_spawn
)
21 os
.kill(self
.lldb_pid
, signal
.SIGTSTP
)
22 self
.child
.expect("STATUS=([0-9]+)")
23 status
= int(self
.child
.match
[1])
25 self
.assertTrue(os
.WIFSTOPPED(status
))
26 self
.assertEqual(os
.WSTOPSIG(status
), signal
.SIGTSTP
)
28 os
.kill(self
.lldb_pid
, signal
.SIGCONT
)
30 self
.child
.sendline("quit")
31 self
.child
.expect("RETURNCODE=0")