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    @skipIf(compiler="clang", compiler_version=['<', '11.0'])
15    @skipIf(oslist=["linux"], archs=["arm", "aarch64"])
16    def test(self):
17        self.build(dictionary={"CXX_SOURCES":"cat.cpp"})
18        self.launch(executable=self.getBuildArtifact())
19
20        self.child.sendline("process launch")
21        self.child.expect("Process .* launched")
22
23        self.child.sendline("Hello cat")
24        self.child.expect_exact("read: Hello cat")
25
26        self.child.sendintr()
27        self.child.expect("Process .* stopped")
28        self.expect_prompt()
29
30        self.expect("bt", substrs=["input_copy_loop"])
31
32        self.child.sendline("continue")
33        self.child.expect("Process .* resuming")
34
35        self.child.sendline("Goodbye cat")
36        self.child.expect_exact("read: Goodbye cat")
37
38        self.child.sendeof()
39        self.child.expect("Process .* exited")
40        self.expect_prompt()
41
42        self.quit()
43