1"""
2Test sending SIGINT Process IOHandler
3"""
4
5import os
6
7import lldb
8from lldbsuite.test.decorators import *
9from lldbsuite.test.lldbtest import *
10from lldbsuite.test.lldbpexpect import PExpectTest
11
12class TestCase(PExpectTest):
13
14    mydir = TestBase.compute_mydir(__file__)
15
16    @skipIf(compiler="clang", compiler_version=['<', '11.0'])
17    @skipIf(oslist=["linux"], archs=["arm", "aarch64"])
18    def test(self):
19        self.build(dictionary={"CXX_SOURCES":"cat.cpp"})
20        self.launch(executable=self.getBuildArtifact())
21
22        self.child.sendline("process launch")
23        self.child.expect("Process .* launched")
24
25        self.child.sendline("Hello cat")
26        self.child.expect_exact("read: Hello cat")
27
28        self.child.sendintr()
29        self.child.expect("Process .* stopped")
30        self.expect_prompt()
31
32        self.expect("bt", substrs=["input_copy_loop"])
33
34        self.child.sendline("continue")
35        self.child.expect("Process .* resuming")
36
37        self.child.sendline("Goodbye cat")
38        self.child.expect_exact("read: Goodbye cat")
39
40        self.child.sendeof()
41        self.child.expect("Process .* exited")
42        self.expect_prompt()
43
44        self.quit()
45