114bd14f9SPavel Labath""" 214bd14f9SPavel LabathTest sending SIGINT Process IOHandler 314bd14f9SPavel Labath""" 414bd14f9SPavel Labath 514bd14f9SPavel Labathimport os 614bd14f9SPavel Labath 714bd14f9SPavel Labathimport lldb 814bd14f9SPavel Labathfrom lldbsuite.test.decorators import * 914bd14f9SPavel Labathfrom lldbsuite.test.lldbtest import * 1014bd14f9SPavel Labathfrom lldbsuite.test.lldbpexpect import PExpectTest 1114bd14f9SPavel Labath 1214bd14f9SPavel Labathclass TestCase(PExpectTest): 1314bd14f9SPavel Labath 14*0bc9372fSAdrian Prantl @skipIf(compiler="clang", compiler_version=['<', '11.0']) 155c6ee130SMuhammad Omair Javaid @skipIf(oslist=["linux"], archs=["arm", "aarch64"]) 1614bd14f9SPavel Labath def test(self): 1714bd14f9SPavel Labath self.build(dictionary={"CXX_SOURCES":"cat.cpp"}) 18af4da4f9SPavel Labath self.launch(executable=self.getBuildArtifact()) 1914bd14f9SPavel Labath 2014bd14f9SPavel Labath self.child.sendline("process launch") 2114bd14f9SPavel Labath self.child.expect("Process .* launched") 2214bd14f9SPavel Labath 2314bd14f9SPavel Labath self.child.sendline("Hello cat") 2414bd14f9SPavel Labath self.child.expect_exact("read: Hello cat") 2514bd14f9SPavel Labath 2614bd14f9SPavel Labath self.child.sendintr() 2714bd14f9SPavel Labath self.child.expect("Process .* stopped") 2814bd14f9SPavel Labath self.expect_prompt() 2914bd14f9SPavel Labath 3014bd14f9SPavel Labath self.expect("bt", substrs=["input_copy_loop"]) 3114bd14f9SPavel Labath 3214bd14f9SPavel Labath self.child.sendline("continue") 3314bd14f9SPavel Labath self.child.expect("Process .* resuming") 3414bd14f9SPavel Labath 3514bd14f9SPavel Labath self.child.sendline("Goodbye cat") 3614bd14f9SPavel Labath self.child.expect_exact("read: Goodbye cat") 3714bd14f9SPavel Labath 3814bd14f9SPavel Labath self.child.sendeof() 3914bd14f9SPavel Labath self.child.expect("Process .* exited") 4014bd14f9SPavel Labath self.expect_prompt() 4114bd14f9SPavel Labath 4214bd14f9SPavel Labath self.quit() 43